Can't register subscriptions; CKError 0x19030580, "Service Unavailable"

720 views Asked by At

Every time when I try to register the subscription, I get the error: CKError 0x19030580: "Service Unavailable" (6/2022); server message = "refused to install an older schema (68f93710-7456-11e4-b13e-008cfac0c800) since we already have 693359e0-7456-11e4-8e42-008cfac03128"; uuid = 42F42F6B-98FB-4774-B735-271C1AEF07F1; container ID = "iCloud.com.*.*". And when I try to get all subscriptions that are on the server, I receive nothing.

Why am I receiving CKError 0x19030580? Why can't I retrieve subscriptions? How should I fix them?


Code:

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


    CKNotificationInfo *notification = [[CKNotificationInfo alloc] init];
    notification.shouldSendContentAvailable = YES;

    notification.alertLocalizationKey = @"New Item available.";
    notification.shouldBadge = NO;

    itemSubscription.notificationInfo = notification;

    [self.privateDatabase saveSubscription:itemSubscription completionHandler:^(CKSubscription *subscription, NSError *error) {
        if (error) {

        } else {
            self.subscribedItems = subscription.subscriptionID;
        }
    }];
3

There are 3 answers

0
Ryde On

I have similar issue. One of my record keep refused to upload. Similar "refused to install an older schema" error came up. First, I thought it's in my code, 2-3 days I try to solve it, but nothing.

Then I try to reset iCloud development container (via iCloud dashboard). Make again the records. Then try to run it again. And it works.

I think it's bug on Apple side. Btw, my affected records not subscription though. But you may want to try it.

Tips, you may want to check if your app already subscribed first before subscribing. I save subscriptionID while subscribe method called in NSUserDefaults. Then I remove it if unsubscribe method called.

0
Ali Beadle On

I had the same "refused to install an older schema" error but with simple writes, not subscriptions. In my case I was writing a record with a field that did not exist. Now I thought that when under the development environment the schema automatically added new field types - but anyway, when I added it manually using the dashboard it worked.

1
Chris On

CloudKit sends CKError.serviceUnavailable when the user has disabled iCloud Drive on their device.