-1

We are trying to develop an application similar to an existing app currently in the app store.

This app is sending location data in the background to a web service, and the app will continue to run following a reboot of the device. I will also note, that following the app being installed and registered, the location services indictor remains constantly on the status bar. I am assuming this is necessary to allow the app to continue to run following a the device being restarted.

We have tried using the "UIBackgroundModes/required background modes for location", and have been unsuccessful in having the app continue to run following a reboot of the device.

Can someone please point us in the right direction as to how to have the app continue to send location data following a device reboot.

Thank you very much!

newb1188
  • 21
  • 4

2 Answers2

0

No app will run following a device reboot. It is not possible to build a file daemon under Apple's SDKs. You'd have to jailbreak the phone and run unauthorized stuff to do so, then you wouldn't be accepted into Apple's app store.

Owen Hartnett
  • 5,925
  • 2
  • 19
  • 35
  • There is an app that does... Is is possible that they are using an MDM server to achieve this? My understanding that GPS and VOIP app will run after reboot...? – newb1188 Dec 04 '12 at 17:02
  • So how would tracking apps work then? if a user reboots their phone it will kill it? – newb1188 Dec 04 '12 at 17:04
  • Yes. No app will survive a reboot. You can't write a daemon. – Owen Hartnett Dec 04 '12 at 17:04
  • Apple can do so, because it's not limited by the SDK. That's why "Find my iPhone" works. But you can't write one under the current developer agreement. – Owen Hartnett Dec 04 '12 at 17:05
  • what about this: http://stackoverflow.com/a/8843745/1876358 and thank you for your responses – newb1188 Dec 04 '12 at 17:11
  • Interesting...I wasn't aware of that. Apparently, if you set your app to be notified following a sufficient geographical change, it will wake your app and run it in the background. You'll probably have to save up all the references it gives you then, as I don't think you can initiate a network command when you're running in the background. So when your app goes to the foreground it can check for unsent notifications and upload them. See also http://stackoverflow.com/questions/9613357/ios-background-application-network-access – Owen Hartnett Dec 04 '12 at 17:41
  • Is this the right code we should be using? We are still having trouble with the app continuing to run after reboot... http://developer.apple.com/library/ios/#samplecode/Regions/Introduction/Intro.html – newb1188 Dec 05 '12 at 12:55
  • That code would be the best place to start. You should look to see if there's anything you have to do to make sure your app starts up, and if you have to set background processing to GPS. – Owen Hartnett Dec 05 '12 at 20:46
0

Yes your app will be restarted if your are monitoring significant location changes or monitoring a region and that region is entered/exited.

In iOS 7 Apple made an important change that will disable these mechanisms if a user force quits your app. They will remain disabled until the user starts your app again.

Mike Gottlieb
  • 966
  • 6
  • 11