如何检查iOS状态栏中的哪些通知处于活动状态?
要获取状态栏托盘上活动的通知列表,我们将使用getdeliverednotifications,您可以在此处了解更多信息。
https://developer.apple.com/documentation/usernotifications/unusernotificationcenter
https://developer.apple.com/documentation/usernotifications/unusernotificationcenter/1649520-getdeliverednotifications
虽然知道我们无法从所有应用程序获取通知,因为这将违反隐私,但是我们可以获取应用程序的通知
苹果提供getDeliveredNotifications(completionHandler:)
它返回仍在通知中心显示的应用程序通知列表。
您可以根据需要编写以下代码。
UNUserNotificationCenter.current().getDeliveredNotifications { (notifications) in
print(notifications)
}热门推荐
10 小侄过生日祝福语简短
11 小店营业的祝福语简短
12 担任老师的祝福语简短
13 饮料吧台祝福语简短大气
14 公司新春搞笑祝福语简短
15 高情商敬酒祝福语简短
16 婚礼祝福语新郎妹妹简短
17 教师答辩通过祝福语简短
18 生女孩红包简短祝福语