Initial delay with NSUbiquitousKeyValueStore

We are using iCloud key value storage(NSUbiquitousKeyValueStore) in our app to store some user data. I moved to a new device and logged into iCloud settings and if I immediately open our app and query for a value it returns nil. After considerable delay say 1 minute and if I query, then the proper stored value is returned. We called synchronize(), but it did not help. Is there any other way we can force sync and get a value immediately.

Thanks Vinoth

Hey Vinoth, when you first sign in to iCloud, there are a wide variety of subsystems trying to sync their data. As a result, there might be a delay when trying to fetch data for NSUbiquitousKeyValueStore. That said, when you launch your app, NSUbiquitousKeyValueStore should automatically try to fetch at a higher priority, so there might be something else going wrong here. Would you be able to file a bug through Feedback Assistant so we can look at some logs?

  1. Install the CloudKit logging profile from https://developer.apple.com/bug-reporting/profiles-and-logs/
  2. Reproduce the issue, remembering the approximate timestamp of when you signed in, when you launched your app, and when the data finally appeared.
  3. Take a sysdiagnose on your device.
  4. File a bug through Feedback Assistant and attach that sysdiagnose.
Initial delay with NSUbiquitousKeyValueStore
 
 
Q