Search code examples
iosbackground-process

How to periodically call to a webservice even when the app is in background?


I want to do some server pulling in my iOS app. It something like this. When m app installed it should start a background service to check weather is there any new data available since the last updated date. If yeas my app should start a local push notification. How can I do this? I want to know how I can periodically check is there any new data available in server even when my app is in background. Please help me. Thanks


Solution

  • On iOS 7 and above, you have Background App Refresh. It's covered in the documentation under Fetching Small Amounts of Content Opportunistically. You can read more about it under Use Background App Refresh.

    One caveat is that the user can turn off Background App Refresh for your app.