有什么方法可以以编程方式将我的iPhone应用程序发送到后台 [英] Is there any way to programmatically send my iPhone app to the background

查看:79
本文介绍了有什么方法可以以编程方式将我的iPhone应用程序发送到后台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iPhone应用程序,需要自动发送到后台.该应用是在后台模式下使用VOIP键定义的,因此在后台运行时应继续运行.我特别需要该应用程序保持运行,因此调用exit(0)不好.

I have an iPhone app that I need to send to the background automatically. The app is defined with the VOIP key in its background modes so it should continue running when in background. I specifically need the app to keep running so calling exit(0) is no good.

该应用不会通过应用商店分发,因此可以使用私有API.

The app will not be distributed via app store so using a private API is ok.

我已经阅读了有关UIApplication终止和UIApplication的TerminateWithSuccess的信息,但是它们似乎不再可用

I have read about UIApplication terminate and UIApplication terminateWithSuccess but they don't seem to be available anymore

推荐答案

在这里已经很好地回答了:

Already answered quite well here:

暂停应用程序

那个海报写道:

以退出程序的方式或以编程方式将其发送到后台违反了[iOS人机界面指南] [1],通常这对于完成审阅过程来说并不是一个好兆头:

Quitting your application or sending it to the background programmatically is a violation of the [iOS Human Interface Guidelines][1], which usually doesn't bode well for getting through the review process:

不要以编程方式退出

从不退出iOS应用程序 以编程方式,因为人们倾向于 将此解释为崩溃.然而, 如果外部环境阻止您 发挥作用的应用程序 意,您需要告诉您的用户 关于情况并解释什么 他们可以做到这一点.取决于如何 应用程序故障严重, 您有两种选择.

Never quit an iOS application programmatically because people tend to interpret this as a crash. However, if external circumstances prevent your application from functioning as intended, you need to tell your users about the situation and explain what they can do about it. Depending on how severe the application malfunction is, you have two choices.

显示一个吸引人的屏幕,描述问题并提出建议. 更正. 可以使用户放心的反馈 你没什么错 应用.让用户掌控一切, 让他们决定是否要 采取纠正措施并继续 使用您的应用程序或按 主页按钮和打开不同 应用

Display an attractive screen that describes the problem and suggests a correction. A screen provides feedback that reassures users that there’s nothing wrong with your application. It puts users in control, letting them decide whether they want to take corrective action and continue using your application or press the Home button and open a different application

如果只有某些应用程序功能不起作用,请显示 屏幕或警报时 人们激活该功能.显示 仅当人们尝试警报时 访问不具备的功能 运行.

If only some of your application's features are not working, display either a screen or an alert when people activate the feature. Display the alert only when people try to access the feature that isn’t functioning.

这篇关于有什么方法可以以编程方式将我的iPhone应用程序发送到后台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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