iOS equivalent to Android Service?

前端 未结 4 1757
庸人自扰
庸人自扰 2020-12-09 22:14

So with iOS 7 supporting a broader background mode, is it possible to finally have an equivalent to Android Service on iOS?

What I am after is essentially running ap

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 23:09

    Basically it's impossible if your app doesn't implement any of the functionalities listed bellow. And they hardly investigate your app before upload it to the store, you need to justify the use of that permissions

    This is what Apple say about that:

    Implementing Long-Running 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 app
    • Apps that record audio content while in the background
    • Apps that keep users informed of their location at all times, such as a navigation app
    • Apps that support Voice over Internet Protocol (VoIP)
    • Apps that need to download and process new content regularly
    • Apps 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.

提交回复
热议问题