- Home /
iOS falls asleep when not touching screen
This was asked before, but not really answered in a way I can use it.
A game that uses accelerometers only, no screen touch, leads to the iOS device falling asleep while playing the game. Touching the screen helps, but is not user friendly. Preventing sleep totally, is against the rules, since it could drain the battery if someone lays the device down and forget's about it, that's why it's automatically shutting down after a while of not using. But it's used. The user is holding the device for playing the game via the accelerometers. Strangely enough, the demo project roll-a-ball does not seem to make the iOS device fall asleep. Am I missing something? A flag, a line of code, a tip, a trick, a checkmark?
Answer by tertle · Feb 08, 2011 at 03:01 AM
iPhoneSettings.screenCanDarken = false;
About all you have. You should turn it back on in menus etc.
where to add this code. I mean which object and on which part of the code, stat or update?
Your answer
Follow this Question
Related Questions
Setting resolutions for iPad and iPhone 0 Answers
How to identify each iOS device? 1 Answer
Xcode build crashes 0 Answers
Grass Won't Show — Any Suggestions on the Cause? 2 Answers
Which device for iOS development? 1 Answer