即使应用终止后,ios 8也会定期进行后台处理 [英] ios 8 periodic background process even after app termination

查看:97
本文介绍了即使应用终止后,ios 8也会定期进行后台处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:我正在处理的这个应用程序完全是出于我自己的用途,不会出现在应用程序商店中,所以请不要给出答案。

我希望我的应用程序每隔几分钟在后台或终止后(双击主页按钮并从应用程序多任务中轻扫应用程序)进行一些处理。这个过程非常轻便快速,因此不会耗尽电池。此过程不应要求互联网连接。我在这里看到了一些答案,我将解释有什么问题:

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。 VoIP的问题是它应该在后台使用 UIApplication.sharedApplication()。setKeepAliveTimeout(..)方法,当应用程序终止时它不起作用或它应该连接到互联网以建立TCP连接并从服务器接收命令,如前所述,我希望它是独立于互联网的。

  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.

位置服务。我找到了这个优秀的网站,有一些很棒的文章,但问题是它只适用于移动手机移动超过500米的情况。这取决于位置移动,因此当手机停留在某处时,将无法执行代码。

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.

播放静音音频循环。这里的问题是如果用户播放另一个音频(完全可能像音乐或电话),应用程序将终止!

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!

越狱启动守护进程。我不能要求越狱所以它应该用非越狱解决方案来解决:(。

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

我是自由的使用任何类型的私有API都没有限制。

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

谢谢高级

推荐答案

我也面临这样的问题,并且没有找到任何解决方案。
主要问题是如果用户手动终止应用程序 - 在这种情况下你不能做任何事情.. 。

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...

唯一的方法是:

a)使用位置服务(正如你所说)

a) use Location Services (as you mention)

b)使用推送通知和后台提取

b) use Push Notifications with background fetch

这篇关于即使应用终止后,ios 8也会定期进行后台处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆