【发布时间】:2016-10-07 08:28:21
【问题描述】:
当我更新我的AppDelegate 类中的所有Notification 方法时。 PushNotification 在应用程序打开和关闭模式时接收。当我的应用程序关闭并且我收到通知并尝试点击通知时,我遇到了这个问题,它打开了应用程序屏幕但是没有调用这些代码行:
let remoteNotification: NSDictionary! = launchOptions?[UIApplicationLaunchOptionsRemoteNotificationKey] as? NSDictionary
print("remoteNotification = \(remoteNotification)")
if (remoteNotification != nil) {
print("***************************************\n\n\n\n\n launchOptions = \(launchOptions)\n ***************************************\n\n\n\n\n")
self.notificationHandlingFunction(remoteNotification)
}
当我想查看日志时,它不会出现在Log 列表中:
我的设备与Xcode 连接,但没有运行。
在代码中我打印RemoteNotification 但是当我搜索这个关键字时它没有显示。
我在Swift 中遇到了这个问题。
出现这种情况时,我该如何管理我的Notification 方法。
【问题讨论】:
标签: ios swift push-notification