4.09 PM
Change backlight brightness on iPhone
- Get the current backlight value stored in Settings
NSNumber *bl = (NSNumber*) CFPreferencesCopyAppValue(CFSTR("SBBacklightLevel"), CFSTR("com.apple.springboard"));
prevBacklightLevel = [bl floatValue]; - Set our new value
GSEventSetBacklightLevel(1.0f); // from 0.0 (off) to 1.0 (max) - Then restore the previous brightness
- (void)applicationWillTerminate
{
GSEventSetBacklightLevel(prevBacklightLevel);
}