Reputation: 345
Is it possible to run a background task on iOS that uploads data to a server every minute or so, like a service on Android?
Upvotes: 1
Views: 2340
Reputation: 4980
There's no way to do it as service except some special cases provided by ios. But you can simulate it. This post answer how to:
https://stackoverflow.com/a/19121250/2835520
I hope it's gonna help!
Upvotes: 0
Reputation: 1443
Nothing like a service but there are certain categories of apps that can be run in the background for an extended period- In addition to VOIP that @lorean mentioned, there are others- audio, location, newsstand , external accessory -https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html . So if your app fits into these categories, then you are set.
Otherwise, you could also run your app as a background audio app by playing silent audio in a loop in the background- but there may be issues trying to get it through the App Store. For instance, you may be required to explicitly inform the user that audio will be played.
Upvotes: 1