Prevent my application from being suspended in background mode? [duplicate]

落花浮王杯 提交于 2019-12-23 04:33:27

问题


My application is suspended by iOS after some time -- from one hour to several days -- but I want it to work in the background as long as possible (maybe infinitely) while the device is running. SMS will notify the user all the time that the device is running -- iOS doesn't kill the SMS service. My app has similar functionality and should notify user about the new income messages and so on.

So can I do the same with my application? Maybe there is some hack?


回答1:


No.

There are the following exceptions:

  • Playing music
  • GPS tracking
  • VoIP

Also, all apps can get up to ten minutes to finish existing tasks.

There should be an answer if you're prepared to jailbreak, but otherwise, it's not possible with current versions of iOS.

The way around this is to do the processing on a server and send push notifications when something interesting happens.




回答2:


You don't want your application running indefinitely.

You should use push notifications. This will notify your user the same way the SMS application does.



来源:https://stackoverflow.com/questions/15663757/prevent-my-application-from-being-suspended-in-background-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!