ios - 当应用程序从推送通知打开时调用 didFinishLaunchingWithOptions

标签 ios apple-push-notifications appdelegate

我已经从后台终止了该应用程序。终止应用程序后,我发送一个推送通知。我对将要调用的 AppDelegate 函数有两个疑问:
1didFinishLaunchingWithOptions 会被调用吗?
2。如果是,将首先调用 didFinishLaunchingWithOptions 还是首先调用 didReceiveRemoteNotification

我无法测试这种情况,因为它无法调试,应用程序从推送通知打开这一事实。

最佳答案

如果您的应用程序处于后台模式,则永远不会调用didFinishLaunchingWithOptions 方法,只会调用didReceiveRemoteNotification 方法

并且如果您的应用程序被终止,则只会调用didFinishLaunchingWithOptions 方法,而永远不会调用didReceiveRemoteNotification 方法。

关于ios - 当应用程序从推送通知打开时调用 didFinishLaunchingWithOptions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34892499/

相关文章:

ios - 防止 UITableView 超出单元格绑定(bind) View 在 insertRowsAtIndexPaths : 上剪辑

ios - 构建iOS ipa时如何选择推送通知类型

ios4 - 苹果推送消息

ios - appDelegate 的 alertView 不会切换 View uppon buttonIndex

ios - 从 AppDelegate 调用函数并使用该函数执行 segue

ios - 导航 Controller 定制不对应

ios - 打开另一个 View 并取消后选择的单元格

ios - 在 MacOS 上安装 TensorFlow-experimental 时出错 - curl : (60) SSL certificate

objective-c - UITabBarController w/Multiple MKMapViews

iphone - Apns 错误 "Failed to connect to APNS: 110 Connection timed out."