1

I'm playing with CloudKit and am confused how and when I should fetch initial records for my local cache at first launch of app. Should I fetch all records before I do the initial subscription, or after?

And it seems like we can skip using queries to fetch data. We could use (and I do use) a CKFetchDatabaseChangesOperation with a nil serverChangeToken.

But it doesn't work well. I don't get any changed zones back at first launch. Data does exist from previous installs, and I also added some through CloudKit Dashboard.

FWIW I use the private database now, and the default zone.

Jonny
  • 15,955
  • 18
  • 111
  • 232

1 Answers1

0

I'm not fully there to understanding this yet, but it seems that we cannot use the defaultZone for this stuff. We have to create a custom zone and use subscriptions for that... I guess there is a good reason for this and a longer explanation but I'll go with this for now... I hope it works too :-P (to use a custom zone). Not sure then when defaultZones are ever useful.

What I did to come here: I forced a check on defaultZone at every app launch, however this came back:

AppDefaultZone does not support sync semantics

which led me here: https://stackoverflow.com/a/25816025/129202

Community
  • 1
  • 1
Jonny
  • 15,955
  • 18
  • 111
  • 232