- Home /
Is it possible to call Update() while running in background in iOS?
I have an iOS that needs to make periodic (every hour or so) www requests even when the iPhone's home button is clicked and the app is sent to the background. Is there a way to do this, or at the very least to send a one-off message via objectiveC in iOS?
Thanks!
Answer by robhuhn · Aug 30, 2013 at 06:44 AM
In some cases background execution is allowed but not for running an Update(). Find some info about background execution [here][1]. In your case it might help to schedule a [local notification][2] and let the user know that he should open the app.
- You need to perform a single finite-length task. - You need to use notifications to alert the user to some relevant piece of information when your app is not running. [1]: https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html [2]: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction.htmlAs much as possible, you are encouraged to avoid executing in the background and let your app be suspended. If you find you need to perform background tasks, here are some guidelines for when that is appropriate:
You need to implement at least one of several specific user services.
Your answer
Follow this Question
Related Questions
Loading files in background 2 Answers
Save a downloaded image 1 Answer
How to change a variable from another script? 1 Answer
Importing files from disk once a game has been built 1 Answer
How To Download A Webpage? 2 Answers