Disable & Enable Idle Timer in iOS SDK
March 2, 2011 § 2 Comments
By default, the idle timer will dim the screen after a period of non use and then turn the power to the screen off. You may need to disable idle timer on a specific app such as a Flash light app or location-based app.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
…
}
Add the following line:
[application setIdleTimerDisabled:YES];
- (void)applicationWillTerminate:(UIApplication *)application {
…
}
Add the following line to re-enable the idle timer:
[application setIdleTimerDisabled:NO];
This won’t work on the Simulator but it definitely works on device.
The idle Timer is about to run me crazy.help…..or call me 2255051618
It should be pretty straight forward?