Why ubiquityIdentityToken returns nil?

2019-01-28 13:11发布

问题:

NSFileManager.defaultManager().ubiquityIdentityToken on some device in some case returns nil, even I set up iCloud Documents in Capabilities and I am logged in to iCloud on device. How reliable operation of the ubiquityIdentityToken do you met? Am I doing something wrong?

On iPhone it returns correctly with a real token, but on iPad it returns with nil, even if I am logged in.

回答1:

To get token, you need additionaly to turn on iCloud Drive on device. If it is off ubiquityIdentityToken will return nil.