如何在查看后删除通知中心的推送通知
有没有办法在点击后处理来自通知中心的推送通知,并在我的应用程序启动时将其删除?
Is there any way to handle the push notification from the Notification Center after being tap, and remove it when my application has already launched?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这是黑客攻击,但您可以通过更改应用程序上的徽章编号来清除所有通知。
如果您已经有一个徽章编号,您不想丢失(上面的示例将简单地清除最后是徽章编号)您可以执行类似的操作
这可能不是最佳实践,但它可以完成工作并且客户不会知道其中的区别。我喜欢称其为临时工。修复直到我偶然发现更好的解决方案。希望这对某人有帮助!
I know this is hack and slash, but you can clear all notifications by changing the badge number on your application.
If you already had a badge number you don't want to lose (above example will simply clear badge number in the end) you can do something like
This may not be best practice, but it gets the job done and the client will not know the difference. I like to call it a temp. fix until I stumble upon a better solution. Hope this helps someone!