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 11-11-2008, 10:40 AM   #3 (permalink)
SkylarEC
New Member
 
Join Date: Nov 2008
Posts: 74
Default

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]
SkylarEC is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,558
Threads: 89,129
Posts: 380,265
Top Poster: BrianSlick (7,104)
Welcome to our newest member, thesooty
Powered by vBadvanced CMPS v3.1.0

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