16

Why did the same account iCloud have another ubiquityIdentityToken?

 3 years ago
source link: https://www.codesd.com/item/why-did-the-same-account-icloud-have-another-ubiquityidentitytoken.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Why did the same account iCloud have another ubiquityIdentityToken?

advertisements

i am trying to implement an App with iCloud Key-value storage feature.

Currently, I'm testing it from two devices iPhone5s with iOS7.0.4 and iPhone4 with iOS6.1.1. Do you guys have any idea why the same iCloud account (checked from Settings -> iCloud -> Account) gets two different ubiquityIdentityToken? i guess this is the reason the data didn't sync between this two devices (network accessed).

And on iOS6, NSUbiquitousKeyValueStoreDidChangeExternallyNotification is not trigging.

Thanks in advance!


The ubiquityIdentityToken is only intended to be used to:

  • Determine if iCloud is available to your app
  • Determine if the iCloud account has changed (by comparing to a previously saved value).

It's opaque but conforms to a few protocols. You can save it locally and compare the current value with a previous value, but that's about all it's good for. It's not guaranteed to be useful in any other situation.

It's not guaranteed to be the same on different devices, even if those devices use the same iCloud account. Why it might be different is not documented-- it might encode a device-specific value somehow. Regardless, it's not something that you can transfer from one device to another and expect to still be useful. That's not how it's designed to work.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK