推送通知 - 捕捉它们?
好吧,这就是交易。
我的应用程序正在使用 iOS 通知。 在应用程序委托中,如果应用程序位于前台,我会在 didReceiveRemoteNotification 中捕获它们 如果应用程序处于后台并且我点击了推送通知,我会在 didBecomeActive 中捕获它。
然而!
如果我的应用程序处于后台,我会收到推送通知,如果我没有点击推送通知(或者在低于 5.0 的 iOS 中只是“取消”),并且打开应用程序,几分钟后,我不知道如何找到这个推送通知。有什么建议吗?
谢谢!
okay, so here is the deal.
my app is using iOS notifications.
in app delegate I am catching them in didReceiveRemoteNotification if the app is in foreground
i catch it in didBecomeActive if app was in background and i tapped on the push notification.
however!
if my app is in background, i receive push notification and if i do not tap on push notifications (or just "Cancel" on it in iOS less than 5.0), and open app in say, couple minutes, i can't figure out how do I find this push notification. any suggestions?
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的应用程序在后台,操作系统将处理推送通知。它设置徽章、显示文本或播放声音。您甚至可以在 iOS5 中指定按下“确定”时应用程序启动的启动图像。
但是,如果您不按“确定”或取消通知弹出窗口,则没有机会捕获任何信息。
如果您从应用程序服务器发送通知,则可以在该服务器上实现一个接口(REST 等),可以要求该服务器提供最后的通知甚至通知历史记录。但这是一个解决方法。
If your app is in background the OS handles the push notifications. It sets a badge, shows a text or plays a sound. You even can specify a launch image in iOS5 what the app launches with when "OK" is pressed.
However if you do not press OK or cancel the notification PopUp, there is no chance to catch any information.
If you send your notifications from an application server, you could implement an interface (REST or such) on that server which can be asked for the last notification or even the notification history. But that is a workaround.