Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone app running while screen locked

Here is something I am trying desperately to get to work:

I have an app that polls the GPS module in specified intervals and then sends out coords out to a server using Unix calls such as write(); It works fine when the app is active, but once the screen locks itself, reporting stops.

I have found this: [UIApplication sharedApplication].idleTimerDisabled = YES; This does keep the app alive, but also rapidly discharges the battery. I came across other apps that stream music even when the screen is locked (non-Apple apps) and thus I figured there has to be a way to keep the GPS data stream alive.

Can anyone assist? Thank you!

like image 232
David Avatar asked Nov 19 '09 17:11

David


People also ask

How do I run an app from the lock screen?

Here's how to open your favorite apps directly from the Lock screen on your Galaxy device: Go to Settings > Lock screen > Shortcuts. Tap Left shortcut and pick your desired app.

Can you use apps on a locked iPhone?

Limitations. You can passcode lock any app on your phone except for the Phone app. There is no option to turn off access to the Phone app at all. For apps like Messages or FaceTime, you need to edit the "Always Allowed" section of Screen Time to remove them for the limit to be enabled.


1 Answers

Have a look at this:

http://marcopeluso.com/2009/08/23/how-to-prevent-iphone-from-deep-sleeping/

It's a drop in piece of code used to disable deep sleep. Your screen can still shut off while your application continues to run in the background.

like image 154
tddmonkey Avatar answered Oct 20 '22 01:10

tddmonkey