类型为CKSubscriptionOptionsFiresOnRecordUpdate的CKSubscription不起作用 [英] CKSubscription of type CKSubscriptionOptionsFiresOnRecordUpdate doesn't work

查看:130
本文介绍了类型为CKSubscriptionOptionsFiresOnRecordUpdate的CKSubscription不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码设置了 CKSubscription

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.");
     }
 }];

application:didReceiveRemoteNotification:当添加新记录时,但是在更新现有记录时却从未收到通知。

In application:didReceiveRemoteNotification: I get notified when a new record is added, but I never get notified when an existing record is updated.

我尝试从CloudKit仪表板和其他已签名的设备更新记录

I've tried updating records from both the CloudKit dashboard and from another device signed into the same account.

我正在iOS 9 beta 5上进行测试。

I'm testing on iOS 9 beta 5.

推荐答案

它是一个已知的错误,无法更新通知。

Its a known bug that update notifications are not working.

[ CKFetchNotificationChangesOperation有时不返回UPDATE,DELETE通知
[有关记录更新的CloudKit推送通知已停止工作
[ https://forums.developer.apple.com/thread/7288] [3]

这篇关于类型为CKSubscriptionOptionsFiresOnRecordUpdate的CKSubscription不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆