As of IPhone OS 3.0, MotionX GPS is able to keep recording a GPS track while in sleep mode. After you push the sleep button on top of the phone, the app continues receiving GPS coordinates and recording them. Does anyone know how they're able to do this? I'm only aware of the method to keep running audio while in sleep mode.
Asked
Active
Viewed 1.0k times
3 Answers
18
I found a great webpage that explains how to do it -
Cached link from Wayback machine
You have to start a timer that plays a sound every 10 seconds. But the sound can be silent.

Brad Parks
- 66,836
- 64
- 257
- 336

smokey_the_bear
- 1,343
- 1
- 12
- 23
-
this is an cool trick, it solves a real problem, and it seems to work for me as well. i'm a little surprised that and app that used this technique would get approved for the app store though, this seems like the kind of thing that might get an app rejected. – beno Nov 04 '09 at 16:10
-
Above link is dead. – Syed Asad Ali Aug 02 '18 at 10:37
-
Added a cached version of the link above – Brad Parks May 11 '20 at 14:09
2
[UIApplication sharedApplication].idleTimerDisabled=YES should do it

Philippe Girolami
- 1,876
- 1
- 13
- 15
-
3THis works to prevent sleep from idleness, but doesn't work if they hit the lock button. MotionX is able to work after hitting the lock button, and it turns the screen off. – smokey_the_bear Oct 11 '09 at 21:08
1
I heard that the [UIApplication sharedApplication].idleTimerDisabled=YES
will leave the screen's background light on, (after the user pressed the sleep button,) which will drain the battery.
But I have not tried this myself, so anybody with experiences correct this if it is wrong.

lionfly
- 479
- 7
- 21
-
1This stops the iphone from getting bored and locking on its own, but it does not prevent the user from physically pressing the sleep button and putting the device to sleep. – Tim Nov 17 '11 at 16:53