【问题标题】:How to test that silent notifications are working in iOS?如何测试静默通知在 iOS 中是否有效?
【发布时间】:2015-08-18 19:26:39
【问题描述】:

我有一个使用无提示通知订阅的程序:

let predicate = NSPredicate(format: "recordID == %@", CKRecordID(recordName: "ListName"))

let silentNotification = CKNotificationInfo()
silentNotification.shouldSendContentAvailable = true
silentNotification.desiredKeys = ["Update"]

let subscription = CKSubscription(recordType: "Lists", predicate: predicate, options: .FiresOnRecordUpdate)
subscription.notificationInfo = silentNotification

saveSubscription(subscription)

我现在可以在 CloudKit 仪表板中看到订阅,但是当更新后面记录的 Update 值时,我的应用程序没有收到通知。

由于静默通知是基于尽力而为的,所以不立即收到它是否正常?我正在使用 iOS 模拟器并希望能够调试我的应用程序,如果使用静默通知,我该怎么做?

【问题讨论】:

    标签: ios swift cloudkit cksubscription


    【解决方案1】:

    这是一个 CloudKit 错误。更新通知仍然无效。

    见: CKSubscription of type CKSubscriptionOptionsFiresOnRecordUpdate doesn't work

    请在苹果https://bugreport.apple.com/ 提交错误报告 很多人已经这样做了,但显然它仍然需要 Apple 更多的关注。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-12
      • 2020-05-28
      • 1970-01-01
      • 2011-11-13
      • 2018-12-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多