如何让在后台运行的iPhone应用程序完全正常运行 [英] How to keep an iPhone app running on background fully operational

查看:555
本文介绍了如何让在后台运行的iPhone应用程序完全正常运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我知道只支持voip,音频和位置应用程序在后台运行,并且它们将在播放音频或使用位置服务等时运行。

first of all, I know there is only support for voip, audio and location apps to run in background and that they will run just while the audio is been played or while using location services, etc.

我想知道的是,如果有办法让我的应用程序在后台运行完全正常运行,那么对电池寿命的影响无关紧要。

What I want to know is if there is a way to keep my app running on background fully operational, doesn't matter the impact on battery's life.

这样,我的应用程序的用户可以从设置中进行选择,以便随时随地保持应用程序,并且只需要他想要的时间。例如,如果他正在等待需要应用程序运行的内容,在收到消息后,他可以关闭保持活动功能。

That way the user of my app can select from settings to keep alive the app whenever he wants and just for the amount of time he wish. e.g if he is waiting for something that requires the app to be running, after receiving the messages he can turn off the keep alive functionality.

我不知道这是否是可能的,但我读过一些帖子,但不幸的是他们没有说怎么=(

I don't know if this is possible but I had read some post that say so but unfortunately they didn't say how to =(

更新:在本教程,我发现Acrobits在Apple Store上有两个应用程序可以迫使应用程序保持活着并在后台唤醒。所以有办法做到这一点吗?

UPDATE: In this tutorial, I found that Acrobits has two apps on the Apple Store that "can force the application to stay alive and awake in the background". So there is a way to do this?

推荐答案

你可以执行在将应用程序定向到后台后的有限时间内执行任务,但仅限于提供的持续时间。运行时间超过此时将导致应用程序终止。请参阅在后台完成长时间运行的任务iOS应用程序编程指南中有关如何为了解决这个问题。

You can perform tasks for a limited time after your application is directed to go to the background, but only for the duration provided. Running for longer than this will cause your application to be terminated. See the "Completing a Long-Running Task in the Background" section of the iOS Application Programming Guide for how to go about this.

其他人背负着在后台播放音频作为后台进程保持活力的方法,但Apple只会接受这样的应用程序。音频播放是一种合法的功能。关于Apple发布的评论指南的第2.16项规定:

Others have piggybacked on playing audio in the background as a means of staying alive as a background process, but Apple will only accept such an application if the audio playback is a legitimate function. Item 2.16 on Apple's published review guidelines states:


多任务应用程序只能将
后台服务用于其预期的
目的:VoIP,音频播放,
位置,任务完成,本地
通知等

Multitasking apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc

这篇关于如何让在后台运行的iPhone应用程序完全正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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