Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-29-2009, 04:32 PM   #4 (permalink)
wuf810
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,049
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
 

» Advertisements
» Stats
Members: 158,724
Threads: 89,183
Posts: 380,501
Top Poster: BrianSlick (7,125)
Welcome to our newest member, blog08space
Powered by vBadvanced CMPS v3.1.0

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