我已收到推送通知,如果我打开推送通知,则 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/