【发布时间】:2016-08-18 03:50:18
【问题描述】:
如何在 didfinishlaunchingwithoptions 中调用方法 didReceiveRemoteNotification?我正在使用快速语言。 当用户直接打开应用时,通知被取消,在didReceiveRemoteNotification 中执行的操作没有被调用。如何处理?
我已经到达这里了。但无法完成
if let options = launchOptions, notification = options[UIApplicationLaunchOptionsRemoteNotificationKey] as? [NSObject : AnyObject] {
self.application(application, didReceiveRemoteNotification: notification, fetchCompletionHandler: _______)
}
【问题讨论】:
-
@SausageMachine 在 didReceiveRemoteNotification 我正在保存这个通知数据。但是当收到通知时,应用程序打开(没有点击通知),通知自动取消并且保存操作没有执行
-
使用 Swift / Objective c 的语言无关紧要,但推送通知的过程将相同。 DidReceiveRemoteNotification 方法将在收到推送通知并点击通知时调用。
-
但是当用户直接打开应用时,通知被取消,在didReceiveRemoteNotification中执行的操作没有被调用。如何处理?
-
您可以使用本地通知。
-
@Anand 通知是从服务器发送的
标签: ios swift appdelegate remote-notifications