Is there a way to prevent iOS6 to kill the specific task process?

前端 未结 2 1059
独厮守ぢ
独厮守ぢ 2021-01-17 02:25

I know that iOS has its own task management method and users may never need to care about the processes background. But my requirement is to ALWAYS keep a program alive, it

相关标签:
2条回答
  • 2021-01-17 02:32

    No, that's not possible. (Nor should it be if you think about it. What's to stop every app from saying that it can't be killed?)

    The closest you can get is for things like VoIP apps that do run in the background and automatically respawn when they die.

    The alternative is to work like every other app: when your app goes into the background you save state so you can restore if it gets killed. iOS 6 even has the state restoration functions.

    0 讨论(0)
  • 2021-01-17 02:47

    Short and simple
    No, there is no way to make your App "unkillable".

    A bit longer
    If your App requires to receive location updates while it is running in background, you can use the standard way Apple offers to do so.

    Two other options are: your App is an VoIP application (afaik they also get autostarted on system boot) or you're playing audio in the background. Without knowing too much details about how iOS handles such Apps, they might get killed if the iDevice runs out of memory (or the user kills it). But you probably already knew that.

    However, as you already mentioned, iOS manages everything on it's own and will kill Apps that run in background to free memory. Additionally as we all know, a user might kill your App at any time using the task switcher of iOS.

    And don't try to use the described methods just to run tasks in the background. If Apple finds out about it, your App will be rejected/removed from the App Store quickly.

    0 讨论(0)
提交回复
热议问题