ios - 推送通知列表

标签 ios apple-push-notifications

我可以从 native 通知中心应用程序获取我的应用程序推送通知列表吗?当我的应用程序启动时,我想显示在我的应用程序未运行时收到的通知。

最佳答案

实际上您可以使用 iOS 10 获取通知列表

为此,您在 UNUserNotificationCenter 中有方法

// Notifications that have been delivered and remain in Notification Center. 
open func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) -> Swift.Void)

然后这样做

UNUserNotificationCenter.current().getDeliveredNotifications(completionHandler: { (notifications) in
      // do what you whant with the notifications array
})

关于ios - 推送通知列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41714415/

相关文章:

ios - XMPPMessageArchivingCoreDataStorage 重复条目 - XMPP MUC

objective-c - 值没有正确增加

php - 我应该将 .pem 文件放在 codeigniter 的什么位置以发送 Apple 推送通知?

ios - 调试通知扩展

ios - Apple 推送通知不起作用

ios - 具有动态 View 的 Xcode Storyboard

ios - 为什么我没有得到 NSString 的输出

ios - 我如何观察用户何时使用生物识别技术对应用程序进行身份验证?

ios - 当我收到静默推送通知时,iOS 会唤醒我的应用程序吗?(当应用程序未处于运行状态时)

xamarin.ios - 某些标记格式的 Azure 通知中心注册失败