推送通知后打开应用程序时执行操作吗?

发布于 2024-12-19 10:10:28 字数 157 浏览 0 评论 0原文

我正在尝试弄清楚推送通知。我有“应用程序确实收到远程通知”的方法,但这仅在通过选择推送通知打开应用程序时有效。我想知道是否有一种方法可以在应用程序打开后通过触摸应用程序图标而不是通知来执行操作。这有道理吗?

我在想“如果徽章编号是 1,那么就做点什么”,但我 不知道如何实现这一点。

I'm trying to figure out push notifications. I have the method "application did receive remote notification", but this only works when the app is opened by selecting the push notification. What I am wondering if there is a way to perform an action after the app is opened by touching the app icon, not the notification. Does this make sense?

I was thinking something like 'if badge number is 1 then do something', but I
not sure how to implement this.

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

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

发布评论

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

评论(1

离笑几人歌 2024-12-26 10:10:28

您可以拨打以下电话获取徽章号码:

[UIApplication sharedApplication].applicationIconBadgeNumber

You can get the badge number by calling:

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