iphonescreenpower-saving

How can we get the iPhone screen to stay active, instead of going into the power saving mode?


I am working on a simple game that requires UIAccelerometer without any screen tapping interaction. In the default mode, the screen goes into a power saving mode periodically. How can I make the screen to stay active throughout the entire time what the app is active?


Solution

  • Use [UIApplication sharedApplication].idleTimerDisabled = YES to prevent the iPhone to go to sleep-mode.