如何检查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 送给学长毕业祝福语简短