【发布时间】:2018-03-12 23:24:49
【问题描述】:
我有问题。我的应用程序中有一条通知。我正在尝试这个。但现在,我无法从图标应用程序中删除。
我运行这段代码:
UNUserNotificationCenter.current().getPendingNotificationRequests(completionHandler: {requests -> () in
print("\(requests.count) requests -------")
for request in requests{
print(request.identifier)
}
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
})
UNUserNotificationCenter.current().getDeliveredNotifications(completionHandler: {deliveredNotifications -> () in
print("\(deliveredNotifications.count) Delivered notifications-------")
for notification in deliveredNotifications{
print(notification.request.identifier)
}
UNUserNotificationCenter.current().removeAllDeliveredNotifications()
})
跟踪是这样的:
0 个请求 ----- 0 发送通知-------
在图标应用中,我看到了这个:
Im can't up image :( but in this, i see a number one on the icon app and red foreground
【问题讨论】: