Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-29-2009, 03:32 PM   #4 (permalink)
wuf810
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 793
Default

Quote:
Originally Posted by SkylarEC View Post
Yes, Apple will reject your app if you mess with the brightness. Although, if you still want to do it, you'd get the current brightness like this:
Code:
-(void)getBacklightLevel;{
	NSNumber *bl = (NSNumber*) CFPreferencesCopyAppValue(CFSTR("SBBacklightLevel" ), CFSTR("com.apple.springboard"));
	 previousBacklightLevel = [bl floatValue]; //a variable to store the previous level so you can reset it.
	 [bl release];
}
And to set the backlight level, add this line
Code:
GSEventSetBacklightLevel(newLevel); //The new level: 0.0 - 1.0.
In order for this to work, you will need to include GraphicsServices.h. Depending on where you get your headers, you may need to add the GSEventSetBacklightLevel(float value); method to the headers, else the method won't quite work. [Some have reported kernel panics by not amending the header, but that has not been my experience]
wow sorry to raise such as an old thread, but does anyone know if this still works. I can't seem to return the current backlight value anymore (I'm sure it worked once)....its for a private app BTW so no App store violations

TIA, Michael.
wuf810 is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,198
Threads: 38,970
Posts: 170,966
Top Poster: smasher (2,567)
Welcome to our newest member, Hendrika
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:38 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.