x


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?

more ▼

asked Feb 08 '11 at 01:59 AM

RolfBertram.com gravatar image

RolfBertram.com
32 10 10 12

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first
iPhoneSettings.screenCanDarken = false;

About all you have. You should turn it back on in menus etc.

more ▼

answered Feb 08 '11 at 03:01 AM

tertle gravatar image

tertle
1.1k 15 18 33

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1999
x1958
x360
x34
x6

asked: Feb 08 '11 at 01:59 AM

Seen: 1491 times

Last Updated: Feb 08 '11 at 01:59 AM