Mohamed Wasiq
Mohamed Wasiq

Reputation: 587

CloudKit Offline Sync

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

Upvotes: 5

Views: 492

Answers (1)

Adolfo
Adolfo

Reputation: 1862

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.

Upvotes: 4

Related Questions