我正在 iOS 设备上解析推送消息。我能够集成整个推送功能并正常工作。我面临的唯一问题是,如何通过单击当设备收到推送通知时,主屏幕上的应用程序图标(当应用程序处于后台或非事件状态时)?
最佳答案
来自Apple Local and Remote Notification Programming Guide
If the app icon is clicked on a computer running OS X, the app calls the delegate’s
applicationDidFinishLaunching:
method in which the delegate can obtain the remote-notification payload. If the app icon is tapped on a device running iOS, the app calls the same method, but furnishes no information about the notification.
因此,总而言之,如果用户没有操作您的远程通知,您将无法获得推送消息的任何详细信息。
指南还说
Although you may define custom properties for the payload, you should never use the remote-notification mechanism for data transport because delivery of remote notifications is not guaranteed.
关于ios - 单击主屏幕中的应用程序图标时获取 IOS 解析有效负载数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28022964/