“查看”委托用于推送通知
当我们点击推送通知警报的“查看”按钮时,是否有任何委托被调用。这是应用程序处于非活动状态时。
Is there any delegate which gets called when we tap on the "View" button of Push Notification alert. This is when App is inactive.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,有。它是
application:didFinishLaunchingWithOptions:
。来自苹果文档:这是参考: 本地和推送通知编程指南 查看处理本地和远程通知部分。
Yes there is. It is
application:didFinishLaunchingWithOptions:
. From the Apple docs:Here is the reference: Local and Push Notification Programming Guide Look at the Handling Local and Remote Notifications section.
浏览一下 推送通知文档,看起来您在
application:DidFinishLaunchingWithOptions:
中收到通知,并且可以使用UIApplicationLaunchOptionsRemoteNotificationKey 从选项字典中检索通知信息
。From a glance at the Push Notification docs, it looks like you get the notification in
application:DidFinishLaunchingWithOptions:
and can retrieve the notification info from the options dictionary usingUIApplicationLaunchOptionsRemoteNotificationKey
.当应用程序处于后台时,无法获取通知负载,因为点击图标时 applicationDidEnterForeground 被调用,并且在此方法中我们无法访问 launchOptions 或 userInfo 字典。
There is no way to get notification payload when app is in background, because when icon is tapped applicationDidEnterForeground is called and in this method we cannot access launchOptions OR userInfo dictionary.