ios - 当我们清除通知时,Apple 推送通知信息丢失

标签 ios objective-c push-notification

我已收到推送通知,如果我打开推送通知,则 didReceiveRemoteNotification 正在调用并且我正在获取通知信息,而不是如果我清除通知并打开应用程序,则不会调用 didReceiveRemoteNotification。如何解决?

最佳答案

如果您从启动图标打开应用程序(而不是从推送通知打开它),didReceiveRemoteNotification 将不会被调用,您将无法访问通知数据。是否清除通知并不重要。

If the action button is tapped (on a device running iOS), the system launches the application and the application calls its delegate’s application:didFinishLaunchingWithOptions: method (if implemented); it passes in the notification payload (for remote notifications) or the local-notification object (for local notifications).

If the application icon is tapped on a device running iOS, the application calls the same method, but furnishes no information about the notification.

关于ios - 当我们清除通知时,Apple 推送通知信息丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24585484/

相关文章:

ios - 来自不同 Storyboard的相同 IBOutlet?

ios - 适用于 iOS 9 和 10 的 Instagram 分享按钮

java - Google Drive Webhook 通知请求正文为空

android - 收到新的FCM消息(前景和背景)时,Android应用程序崩溃

ios - 如果应用程序已终止,将调用 performFetchWithCompletionHandler

ios - 如何更改 UITabbarController 的更多 ViewControllers UITableViewCells 图像?

ios - 加密直播在IOS5不播放,在IOS4播放

ios - 按后退按钮后 UIWebView 仍然处于事件状态

iphone - 离开页面后TableViewCells被删除

ios - 推送通知不适用于 ios 8.3?