How to get current active iCloud account username in iOS device to show it in my application?
Code from the comment below by OP
NSURL ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
if (ubiq)
{
NSLog(@"iCloud access at %@", ubiq.user); // TODO: Load document...
}
else
{
UIAlertView alert=[[UIAlertView alloc]initWithTitle:@"No iCloud access" message:@"Please set your iCloud account in Setting-iCloud" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; // [alert show]; NSLog(@"No iCloud access");
}
If you know how to to show iCloud account username please tell me. I have already searched for this, but I could not find any answer for my case.
Below is the step by step guide to help you in retrieving iCloud data by using restore and reset “Erase all content and settings”. Step 1: Open the “Settings” app on your iPhone. Step 4: Sign in with your Apple ID and then select the backup file to restore the data.
Sign in to iCloud to access your photos, videos, documents, notes, contacts, and more. Use your Apple ID or create a new account to start using Apple services. iCloud
With Xcode Cloud, you can automatically and frequently: Build your project. Run tests and perform verifications. Distribute builds to testers and gather their feedback with TestFlight while protecting user privacy.
iMyFone iCloud Data Recovery or iMyFone iCloud Data Recovery Mac version is a smart data recovery tool through which your lost data or existing data on your iOS device can be easily recovered or extracted.
You can't do it. The details of the iCloud account are not available to third party apps. All you can find out is whether iCloud is available to your app. The username is not available via any public API. The ubiquity container URL does not encode the iCloud user name, and neither does NSFileManager
's ubiquityIdentityToken
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With