iOS的推送通知 - 如何获得通知的数据当你点击应用程序图标,而不是通知 [英] iOS Push Notification - How to get the notification data when you click on the app icon instead of notification

查看:484
本文介绍了iOS的推送通知 - 如何获得通知的数据当你点击应用程序图标,而不是通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题类似:<一href=\"http://stackoverflow.com/questions/6732427/how-do-i-access-remote-push-notification-data-on-applicationdidbecomeactive\">How我做访问applicationDidBecomeActive远程推送通知的数据?

但不同的是,你怎么能当你在 applicationDidBecomeActive 如果您点击应用程序图标,而不是推送通知访问通知数据。

But the different is how can you access the notification data when you are inapplicationDidBecomeActive and if you have clicked on the app icon instead of the push notification.

流程是:如果你点击推送通知然后 didReceiveRemoteNotification 将被触发,但如果你点击对原有应用程序图标,只有 applicationDidBecomeActive 将被触发, didReceiveRemoteNotification 将不会被调用。

The flow is: If you click on the push notification then didReceiveRemoteNotification will be triggered, but if you click on the original app icon, only applicationDidBecomeActive will be triggered and didReceiveRemoteNotification will not be called.

我要寻找后一种情况下让我怎么能访问推送通知的数据。

I am looking for the later case so how can I access the push notification data.

(这两种情况下,假设应用程序在后台,但没有被杀死。)

(Both case assuming the app is in background and not killed yet.)

推荐答案

您无法从主屏幕启动应用程序获取远程推送有效载荷。

You can't get remote push payload by launching app from homescreen.

如果推数据是使用应用的重要应用推出后,从您的服务器加载它。

If the push data is important for app use, load it from your server after app launched.

这篇关于iOS的推送通知 - 如何获得通知的数据当你点击应用程序图标,而不是通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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