I want to send data to my web server while the app is closed. Is that possible? I’ve read I can send the position, but I waant to send some id of the phone too.
If it’s not possible to have the app running, could I at least communicate with it from my server and then do stuff in the background?
Thanks
When the app goes into the background the
applicationDidEnterBackgroundmethod on your App Delegate will get called.In that method you can use the
beginBackgroundTaskWithExpirationHandleronUIApplicationobject to start background processing.Just realise that you don’t get forever to perform tasks in the background. You can find out how long you have left by reading the
backgroundTimeRemainingproperty inUIApplicationif you need to know if you’re running out of time.If your processing is short you should be fine, but remember if your processing requires network access then you can’t be sure how long that will take.