Yes, I am calling it from main thread. ubiquityIdentityToken return nil. According to the documents, the main thread is only related to the time consumption, not related to permission.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: