Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudKit Offline Sync

Tags:

I'm working on a CloudKit app. Can fetchAllLongLivedOperationIDs be used to handle offline changes?

What's the use of longLivedOperationWasPersistedBlock?

I see that longLivedOperationWasPersistedBlock gets called even when the app is offline

like image 871
Mohamed Wasiq Avatar asked Feb 28 '18 09:02

Mohamed Wasiq


People also ask

Do CloudKit apps sync with iCloud users?

Sync user data between multiple apps from the same developer If you have a suite of apps, they can all share the same CloudKit container so users can have access to their data for all of your apps on every device they have associated with their iCloud account.

What is Apple CloudKit used for?

CloudKit is a framework that lets app developers store key-value data, structured data, and assets in iCloud. Access to CloudKit is controlled using app entitlements. CloudKit supports both public and private databases.

Is CloudKit a backend?

CloudKit it's Apple's Backend as a Service platform and it's specially designed for iOS apps. CloudKit was introduced in the year 2014 as an amazing solution to integrate iCloud in your applications with ease. This cloud solution has been introduced by Apple.

Is CloudKit free?

The answer is: free. Apple allows using CloudKit for 10 GB of resource storage, 100 MB of data storage, and 2 GB of daily transfer, scaling with your user base up to to 1 petabyte of resources, 10 TB database, and 200 TB transfer.


1 Answers

In order to work with CloudKit you must be online. Being offline returns a CKError detailed and Internet Connecction error.

fetchAllLongLivedOperationIDs only returns the operations IDs that are running or had finished in a short period of time.

If you goes offline you need some kind of local persitance engine. It could be Core Data, KeyedArchive or something like that.

like image 151
Adolfo Avatar answered Sep 20 '22 13:09

Adolfo