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

查看:86
本文介绍了有没有办法以编程方式将我的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

推荐答案

这里已经回答得很好:

暂停申请

正如海报所写:

退出申请或以编程方式将其发送到后台违反了[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.

显示一个有吸引力的屏幕,描述问题并建议
更正。
一个屏幕提供
反馈,让用户放心
你的
申请没有任何问题。它让用户掌控,
让他们决定是否想要
采取纠正措施并使用你的应用程序继续
或按
Home按钮并打开另一个
应用程序

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天全站免登陆