【问题标题】:UNUserNotificationCenter.current().getDeliveredNotifications only returns empty arrayUNUserNotificationCenter.current().getDeliveredNotifications 只返回空数组
【发布时间】:2018-06-19 12:03:40
【问题描述】:

我正在尝试检索仍显示在通知中心的所有已发送通知,但 UNUserNotificationCenter getDeliveredNotifications(completionHandler:) 不起作用。我可以使用UNUserNotificationCenter getPendingNotificationRequests(completionHandler:) 获取所有待处理的通知,但getDeliveredNotifications 将始终返回 0 计数,即使通知中心上有通知。

【问题讨论】:

    标签: swift swift3 unusernotificationcenter unnotificationrequest


    【解决方案1】:

    据此:NUserNotificationCenter.current().getDeliveredNotifications only ever returns an empty array

    将徽章编号设置为 0 将清除您的远程通知。

    这可能是问题吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-03
      • 2020-09-03
      • 1970-01-01
      • 2012-11-12
      • 1970-01-01
      • 2011-04-15
      • 2017-07-12
      • 1970-01-01
      相关资源
      最近更新 更多