iOS:用户选择“取消”后如何获取推送通知对象在通知警报对话框中,然后手动启动应用程序

发布于 2025-01-08 16:24:05 字数 447 浏览 4 评论 0原文

可能的重复:
推送通知 - 捕获它们?

问题是:

  1. iOS 收到推送通知并弹出一个带有“取消”和“查看”两个按钮的警告对话框,并且应用程序图标上的徽章编号增加 1

  2. 用户点击“取消”按钮,警报对话框消失,应用程序图标徽章编号保持不变

  3. 用户通过点击主屏幕中的应用程序图标启动应用程序

如何获取推送通知对象或数据应用程序启动后在其中?

(或者是否有办法在推送通知到达时引起注意并在 iOS 弹出警报对话框之前获取其中的数据?)

Possible Duplicate:
Push notifications - catching them?

The question is :

  1. the iOS receives a push notification and pops up an alert dialog with two button "Cancel" and "View", and the badge num on the application icon increases by 1

  2. User taps the "Cancel" button and the alert dialog just dismisses, the application icon badge num remains unchanged

  3. User lauches the application by tapping the application icon in the homescreen

How to get the push notification object or data in it after the application launch ?

(Or is there anyway to get noticed when a push notification arrives and fetch the data in it before the iOS pops out the alert dialog ?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

辞取 2025-01-15 16:24:05

不幸的是,如果您的用户忽略推送通知,您的应用将没有机会从该通知接收信息,因为 didReceiveLocalNotification: 将不会被调用。

相反,您必须使用应用程序服务器来存储有关发出的通知的信息,并在每次启动应用程序时获取该信息。

Unfortunately, if your user ignores a push notification, your app doesn't get an opportunity to receive information from that notification, since didReceiveLocalNotification: will not be called.

You would instead have to use your application server to store information about the notifications that went out, and fetch that information each time you start your app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文