推送通知 - 抓住他们? [英] Push notifications - catching them?

查看:26
本文介绍了推送通知 - 抓住他们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这是交易.

我的应用正在使用 iOS 通知.在应用程序委托中,如果应用程序处于前台,我会在 didReceiveRemoteNotification 中捕获它们如果应用处于后台,我会在 didBecomeActive 中捕获它,然后我点击了推送通知.

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.

但是!

如果我的应用在后台,我会收到推送通知,如果我没有点击推送通知(或者在低于 5.0 的 iOS 中点击取消"),然后在几分钟内打开应用程序,我不知道如何找到此推送通知.有什么建议吗?

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?

谢谢!

推荐答案

如果您的应用在后台,操作系统会处理推送通知.它设置徽章、显示文本或播放声音.您甚至可以在 iOS5 中指定一个启动图像,当按下确定"时应用程序将启动什么.

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.

如果您从应用程序服务器发送通知,您可以在该服务器上实现一个接口(REST 或类似的),可以要求提供最后一个通知甚至通知历史记录.但这是一种解决方法.

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.

这篇关于推送通知 - 抓住他们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆