开发者

Performing background task in an app on iphone

开发者 https://www.devze.com 2023-01-18 13:20 出处:网络
I want my app to poll server for updates and download them when the app is running in the background. How can I achieve this. Can anybody tell me where to start from?开发者_StackOverflow

I want my app to poll server for updates and download them when the app is running in the background. How can I achieve this. Can anybody tell me where to start from?开发者_StackOverflow

Any help would be appreciated.


Generally, Apple wants you to use push, not pull, because it conserves battery life. However, if you want to go with the polling, there are some things to look into. The Apple Documentation describes background tasks in depth here. (Note that you may need to be a registered developer to see it. It sounds like you already are though.) Particularly, you want to use these methods:

  • applicationWillResignActive:

  • applicationDidEnterBackground:

  • applicationWillEnterForeground:

  • beginBackgroundTaskWithExpirationHandler:

0

精彩评论

暂无评论...
验证码 换一张
取 消