iosobjective-cbackground-taskbackground-threaduibackgroundtask

How to make network call when the app is in background too


I have an app if it goes background it has to make network API call every 1 minute.

So far what I studied suggests it's not possible.

Is there any way or workaround to do it But I couldn't find any so far ?

Thanks


Solution

  • You can utilize background fetch api introduced in ios 7, there are few limitation's while using this api but overall it is a good way of updating apps in the background. limitations including but not limited to only 30 seconds time is allotted, cannot execute when battery is low, for the most part cannot set exact time as system decides it, for more info go through these articles

    http://www.appcoda.com/ios7-background-fetch-programming/

    http://code.tutsplus.com/tutorials/ios-7-sdk-working-with-background-fetch--mobile-20520

    http://www.devfright.com/ios-7-background-app-refresh-tutorial/

    Hope it helps !