[英]Know if iOS notification was dismiss
Is there any way to know if a local notification was dismiss from the Notification Center (for example by pressing the x button)? 有没有办法知道本地通知是否从通知中心解除(例如按下x按钮)?
Is it possible to get a list of all the notifications currently visible in the Notification Center? 是否可以获取通知中心当前可见的所有通知的列表?
No it's not possible to get list of notifications from any of APIs from Apple. 不可以从Apple的任何API获取通知列表。 And no there is no feedback from ignored / closed notifications. 并且没有忽略/关闭通知的反馈。
If you want to implement logic like that, I would propose to build this type of logic based on your own servers. 如果你想实现这样的逻辑,我建议基于你自己的服务器构建这种类型的逻辑。
Keep in mind that notifications are not always delivered - it's not guarantee that user will get them and if use has notifications turned of for your application - all notifications will be treated as ignored. 请记住,通知并非始终传递 - 并不保证用户会获得通知,如果使用已为您的应用程序启用通知 - 所有通知都将被视为已忽略。 To improve that logic you may want to send information about user permissions for notifications to your servers - which still is not guarantee that he didn't disable them in settings :( 要改进该逻辑,您可能希望将有关通知的用户权限的信息发送到您的服务器 - 这仍然不能保证他没有在设置中禁用它们:(
Long story short - never ever build any of your application core functionality based on notifications. 简而言之 - 永远不会根据通知构建任何应用程序核心功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.