Which method is better to decide which user is logged in?
let ubiquityIdentityToken = NSFileManager.defaultManager().ubiquityIdentityToken
returns a token, and the client can compare it, as well as last time. The advantage is that it returns a token if the device is also disconnected.
accountStatusWithCompletionHandler returns only the status value, but not the identifier or token about who is logged in. Therefore, offline it is useless.
I'm right?
My other problem is that sometimes even the user logs in, and online ubiquityIdentityToken returns nil.
How to get user id at startup?
source share