I have an app that utilizes the video camera so the screen cannot dim. Inhibiting the screen from dimming works fine like so:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
However when the app is closed and enters the background, setting the IdleTimer back to NO is not working. The screen stays on forever on the home screen. This is how I am trying to accomplish this.
- (void)applicationWillResignActive:(UIApplication *)application
{
[[UIApplication sharedApplication] setIdleTimerDisabled:NO];
}
Is there a better place to add this line of code?
The same problem was occuring with me. Actually it does work but only works when your device is not connected to xCode. Try disconnecting the device and then test this functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With