只有几种特殊的情况允许后台执行较长时间,比如多媒体播放,电子杂志,下载之类,文档里有。Implementing Long-Running Background Tasks
For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background:
Apps that play audible content to the user while in the background, such as a music player appApps that keep users informed of their location at all times, such as a navigation appApps that support Voice over Internet Protocol (VoIP)Newsstand apps that need to download and process new contentApps that receive regular updates from external accessories
Apps that implement these services must declare the services they support and use system frameworks to implement the relevant aspects of those services. Declaring the services lets the system know which services you use, but in some cases it is the system frameworks that actually prevent your application from being suspended