How to test that silent notifications are working in iOS?

555 Views Asked by At

I have a program using subscriptions with silent notification:

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)

I now can see the subscription in CloudKit dashboard but, when updating the Update value of the record followed, my app doesn't receive a notification.

As silent notifications are based on best-effort is it normal to don't receive it immediately? I'm using the iOS simulator and would like to be able to debug my app, how can I do that when using silent notifications?

1

There are 1 best solutions below

0
On BEST ANSWER

This is a CloudKit bug. Update notifications are still not working.

See: CKSubscription of type CKSubscriptionOptionsFiresOnRecordUpdate doesn't work

please file a bug report at apple at https://bugreport.apple.com/ many people already have done the same, but apparently it still need more attention from Apple.