user2892422
user2892422

Reputation: 11

iPhone App running in background and sending data to the server

I'm planning to develop an app reading data usage from the iPhone like each app internet usage , 3G, WiFi etc. My question is:

V1. Is it possible to keep app running in the background (even when is killed) and collecting a data and sending to the server every 15min?

V2. Is it possible to keep app running in the background (even when is killed) and collecting a data and send the data to the server once is reopen?

There are apps like which have similar functionality:

http://www.mobidia.com/products/takecontrol/

http://xvision.me/dataman

Thanks for your help.

Upvotes: 1

Views: 2486

Answers (2)

Prashant
Prashant

Reputation: 1064

I don't think you're allowed to do either when the app is in suspended mode. There is no app code being executed at that state.

When your app is in background though there is only a limited number of tasks you are allowed to perform.

  • Apps that play audible content to the user while in the background, such as a music player app
  • Apps that record audio content while in the background.
  • Apps that keep users informed of their location at all times, such as a navigation app
  • Apps that support Voice over Internet Protocol (VoIP)
  • Apps that need to download and process new content regularly
  • Apps that receive regular updates from external accessories

For more info look here

Upvotes: 2

Mike Gottlieb
Mike Gottlieb

Reputation: 966

First of all it is not possible to keep your app open if the user force quits, which I believe is what you mean by killed.

As far as background execution goes check out this informative answer: iPhone - Backgrounding to poll for events

In that answer it says you can't make recursive beginBackgroundTask calls, but I've seen a method where you make that call and then start location updates before the task dies. Then immediately shut of location updates and begin another background task. Here is a link to that method

Upvotes: 0

Related Questions