I'm working on an app that needs to be able to retrieve small amounts of data from another device. I'm sure this isn't a problem when the app is in the foreground on both devices, but what should I do when it's in the background on one? This would basically be the same as Apple's "Find My Friends", but I have to work around Apple's restrictions on background processing (which they obviously didn't have to do)... Any ideas?
-
What kind of data? Location data? – Emil Oct 06 '12 at 14:05
1 Answers
There are several answers here:
1) if you plan to submit your application to AppStore
In this case, you can't do it. Apple has very strict rules on what could be done in the background. And only three types of applications can do anything: Audio players, VOIP apps, Location based apps. In the case, if your app doesn't fall under one of this categories, they won't approve app which does something (as example share data) in the background
2) If you don't plan to submit your application to AppStore (as example developing Enterprise app or an app for your own needs)
In this case you can abuse Location manager and expiration handler to make your app run in the background.
Here are couple of questions related to this abuse cases:
iPhone - Backgrounding to poll for events
setKeepAliveTimeout and BackgroundTasks
http://www.slideshare.net/tranq72/ios4-multitasking-development-notes

- 1
- 1

- 22,758
- 18
- 92
- 184
-
Yeah I knew all that, was hoping there was a workaround but I guess not :/ – user1664016 Sep 11 '12 at 22:36