简体   繁体   中英

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

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 !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM