如何检查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 婆婆高寿祝福语大全简短