gpt4 book ai didi

ios - CloudKit 订阅有时不起作用

转载 作者:技术小花猫 更新时间:2023-10-29 11:23:40 26 4
gpt4 key购买 nike

如果我尝试使用此代码订阅 CloudKit:

    NSPredicate *truePredicate = [NSPredicate predicateWithValue:YES];
CKSubscription *itemSubscription = [[CKSubscription alloc] initWithRecordType:RecordType
predicate:truePredicate
options:CKSubscriptionOptionsFiresOnRecordCreation | CKSubscriptionOptionsFiresOnRecordUpdate | CKSubscriptionOptionsFiresOnRecordDeletion];


CKNotificationInfo *notification = [[CKNotificationInfo alloc] init];
notification.alertBody = @"Item Added/Updated/Deleted!";
itemSubscription.notificationInfo = notification;

[self.publicDatabase saveSubscription:itemSubscription completionHandler:^(CKSubscription *subscription, NSError *error) {
if (error) {
// In your app, handle this error appropriately.
NSLog(@"An error occured in %@: %@", NSStringFromSelector(_cmd), error);
} else {

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:subscription.subscriptionID forKey:kSubscriptionID];
[defaults synchronize];
}
}];

我有时会遇到这个错误:

CKError 0x17558460:“服务器拒绝请求”(15/2000);服务器消息=“内部服务器错误”; uuid = B89DE7A4-9D22-42BC-9CD4-4330F3FE04EF;容器 ID = "iCloud.com.app.testApp"

CKError 0x14fb3510:“服务不可用”(6/2022);服务器消息 = “无法安装架构,CAS 失败”; uuid = F562D1AD-B40E-4842-A5EA-2A5F800C18F2;容器 ID = "iCloud.com.app.testApp"

有人知道怎么解决吗?我可以用我的代码做些什么吗?这是苹果的问题,我什么也做不了?谢谢。

最佳答案

我最近遇到了类似的错误,并且能够通过在项目的功能中切换 CloudKit 来解决它。一旦我重置了 CloudKit 权限,一切似乎都运行良好。

关于ios - CloudKit 订阅有时不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26092901/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com