Search code examples
iphoneiosxcodebackgroundapple-push-notifications

Update my app when it is in background


I want to update some data to my application. Consider the application is in the background state, it is neither Voip or Music or GPS. Is it possible to update/send data to the application which is in background?

NOTE: I dont want to notify the user so that the application becomes active.

Can anyone help me ??


Solution

  • The answer is yes and no.

    Apple does allow you app to complete a lengthy process in the background. But if you does not fall in the Voip, music or GPS category then you can't run in background.

    If for example you want to send some data to a server, which could take some time, then you can mark that process to back executed until it is finished (or 10min. have passed).

    You will find some about Executing a Finite-Length Task in the Background

    There is not way to run timers or any thing like that in the backgroud, you can only finish a task you started before the app is backgrounded.