防止我的应用程序在后台模式下挂起? [英] Prevent my application from being suspended in background mode?

查看:143
本文介绍了防止我的应用程序在后台模式下挂起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序在一段时间(从一小时到几天)后被iOS暂停了,但是我希望它在设备运行时尽可能长时间(可能无限期)在后台运行. SMS会始终在设备运行时通知用户-iOS不会终止SMS服务.我的应用程序具有类似的功能,应该将新的收入消息通知用户,等等.

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?

推荐答案

否.

有以下例外情况:

  • 播放音乐
  • GPS跟踪
  • VoIP

此外,所有应用程序最多可以有十分钟的时间来完成现有任务.

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

如果您准备越狱,应该有一个答案,但是否则,在当前版本的iOS中是不可能的.

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.

这篇关于防止我的应用程序在后台模式下挂起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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