如何检查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 入住酒店文案祝福语简短