ios 8 periodic background process even after app termination

自闭症网瘾萝莉.ら 提交于 2019-12-13 06:00:33

问题


NOTE: This app I am working on is completely for my own usage and will not be on app store so please don't give answers referring that.

I want my app to do some process in background or after termination (double tap the home button and swipe the app from applications multitask) every few minutes. The process is very very light and quick so it won't drain the battery. This process shouldn't require internet connection. I have seen some answers here like and I will explain what are the problems:

  1. VoIP. The problem with VoIP is wither it should be in background to use UIApplication.sharedApplication().setKeepAliveTimeout(..) method which doesn't work when the app is terminated or it should be connected to the internet to establish tcp connection and receive commands from sever and as mentioned before I want it to be internet independent.

  2. Location Services. I found this excellent site with some great articles but the problem is it only works when the mobile phone is moved more than 500 meters. It depends on the location movement so when the phone is staying somewhere there will be no code execution.

  3. Playing an silent audio loop. The problem here is if the user plays another audio (which is completely possible like music or phone call) the app will terminate!

  4. Jailbreak Launch Daemons. I can't require jailbreak so it should be solved with a non-jailbreak solution:(.

I am free to use any kind of private-API's and there will be no restriction for that.

Thanks in advanced


回答1:


I also faced with such problem, and don't find any solution. The main problem is if user manually terminated app - in this case you can't do nothing...

Only way is:

a) use Location Services (as you mention)

b) use Push Notifications with background fetch



来源:https://stackoverflow.com/questions/32033207/ios-8-periodic-background-process-even-after-app-termination

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