NikolajSvendsen
NikolajSvendsen

Reputation: 345

Background process for sending data to server

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

Answers (3)

IgniteCoders
IgniteCoders

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

rajagp
rajagp

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

lorean
lorean

Reputation: 2150

Not like Android. Only when the app is running in the foreground.

Upvotes: 1

Related Questions