Push notifications - catching them?

安稳与你 提交于 2019-12-01 06:40:41

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/7897026/push-notifications-catching-them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!