How is it possible that CKQueryNotification reason is RecordUpdated but recordFields is nil?

297 Views Asked by At

println("queryNotification.recordFields.keys: \(queryNotification.recordFields?.keys)")

I do not catch how it this log possible? If I get a notification that record was updated, than I need at least one field that was changed, isn't it? Btw I am changing one field on an other device, so I do not see the reason why recordFields is nil, it should have at least one key-value.

enter image description here

enum CKQueryNotificationReason : Int {
    case RecordCreated
    case RecordUpdated
    case RecordDeleted
}
1

There are 1 best solutions below

0
On BEST ANSWER

Need to set desiredKeys when subscription being created.

subscription.notificationInfo.desiredKeys = ["neededField"]