Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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;
        }
    }];
like image 734
Mikhail S Avatar asked Nov 25 '14 08:11

Mikhail S


2 Answers

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.

like image 178
Ryde Avatar answered Nov 04 '22 15:11

Ryde


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.

like image 44
Ali Beadle Avatar answered Nov 04 '22 13:11

Ali Beadle