iphone - 如果应用程序意外关闭,如何重新启动应用程序

标签 iphone ios sdk background restart

Skype update text包含下一个:

App auto restarts if unexpectedly shut down

如何通过 SDK 执行此操作?

最佳答案

据我所知,某些应用程序可以在后台运行,并且可以在特定情况下重新启动。这是来自 Apple 文档

https://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/doc/uid/TP40007125

If you start this service and your application is subsequently terminated, the system automatically relaunches the application into the background if a new event arrives. In such a case, the options dictionary passed to the application:didFinishLaunchingWithOptions: method of your application delegate contains the key UIApplicationLaunchOptionsLocationKey to indicate that your application was launched because of a location event.

我的观点是:Skype 重新推出了远程通知机制。

更新

好吧,我想我找到了一些东西。 @Malek_Jundi 只对了一半。您的应用程序应该失败并返回非零退出代码,但它应该注册为 VoIP 应用程序。

Because VoIP applications need to stay running in order to receive incoming calls, the system automatically relaunches the application if it exits with a nonzero exit code. (This could happen in cases where there is memory pressure and your application is terminated as a result.) However, terminating the application also releases all of its sockets, including the one used to maintain the VoIP service connection. Therefore, when the application is launched, it always needs to create its sockets from scratch.

http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW12

关于iphone - 如果应用程序意外关闭,如何重新启动应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10395142/

相关文章:

iphone - UITableView 部分索引与搜索栏重叠

ios - NSLayoutConstraints 未设置(swift 3)

FB 点赞/Twitter 关注/Youtube 订阅的 iOS 游戏币

ios - 具有用户身份验证功能的 Facebook Like 按钮

java - 使用 Android 创建位置簿

ios - swift 项目中的 ooVoo SDK 编译错误

html - Iphone 7 Safari 文本跳转问题

ios - 如何以编程方式截取可扩展uitableview的屏幕截图

iphone - 核心数据对象比较

ios - SPTYourMusic 请求后,包含 SPTListPage 的响应中的项目为零