ios 8 periodic background process even after app t

2019-09-08 13:22发布

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条回答
再贱就再见
2楼-- · 2019-09-08 13:49

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

查看更多
登录 后发表回答