2014-10-06 29 views
1

println("queryNotification.recordFields.keys: \(queryNotification.recordFields?.keys)")CKQueryNotification原因是如何可能RecordUpdated但recordFields是零?

我不知道這個日誌怎麼可能?如果我收到更新記錄的通知,則至少需要一個已更改的字段,不是嗎?順便說一句,我正在改變其他設備上的一個領域,所以我沒有看到爲什麼recordFields爲零的原因,它應該至少有一個鍵值。

enter image description here

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

回答

3

需要設置desiredKeys創建訂閱時。

subscription.notificationInfo.desiredKeys = ["neededField"]

相關問題