问题
I setup a CKSubscription
with the following code:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"TRUEPREDICATE"];
CKSubscription *subscription = [[CKSubscription alloc] initWithRecordType:@"RecordTypeName"
predicate:predicate
subscriptionID:@"Subscription1"
options:CKSubscriptionOptionsFiresOnRecordCreation | CKSubscriptionOptionsFiresOnRecordUpdate];
CKDatabase *privateDatabase = [[CKContainer defaultContainer] privateCloudDatabase];
[privateDatabase saveSubscription:subscription completionHandler:^(CKSubscription * _Nullable subscription, NSError * _Nullable error) {
if (error) {
NSLog(@"Failed to subscribe.");
}
}];
In application:didReceiveRemoteNotification:
I get notified when a new record is added, but I never get notified when an existing record is updated.
I've tried updating records from both the CloudKit dashboard and from another device signed into the same account.
I'm testing on iOS 9 beta 5.
回答1:
Its a known bug that update notifications are not working.
[CKFetchNotificationChangesOperation sometimes does not return UPDATE, DELETE notifications [CloudKit push notifications on record update stopped working [https://forums.developer.apple.com/thread/7288][3]
来源:https://stackoverflow.com/questions/31905152/cksubscription-of-type-cksubscriptionoptionsfiresonrecordupdate-doesnt-work