CKSubscription of type CKSubscriptionOptionsFiresOnRecordUpdate doesn't work

岁酱吖の 提交于 2019-12-11 03:37:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!