The new iCloud service has many possible configurations. How may I know if the device of my user is configured to send taken pictures to an iCloud server instead of storing them just on the device ?
iCloud Photo Library is not enabled – Use your iPhone or iPad to navigate to Settings > [Your Name] > iCloud > Photos and make sure the slider next to iCloud Photos is green. If it is, iCloud Photos is enabled. If it's not, just tap it to change color and turn it on.
On your iPhone, iPad, or iPod touchGo to Settings > your name. Tap iCloud. Tap to choose which apps you want to use iCloud.
Once you've installed iCloud For Windows, open it and sign in with your Apple ID. Use the same Apple ID that you use on your iPhone. Click the New Shared Album button at the top of the screen. Add the iCloud email addresses for the people you want to invite.
If you want to know if iCloud is activated you could simply call:
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *cloudURL = [fileManager URLForUbiquityContainerIdentifier:nil];
if (cloudURL != nil) {
// iCloud is available
}
This can give you a hint if iCloud is available at all. If you want to use iCloud to store pictures you can build your own stuff. I'm not really sure what you are planning to do.
As long as you give a valid ubiquity container identifier below method should return YES
:
static NSString *UbiquityContainerIdentifier = @"ABCDEFGHI0.com.acme.MyApp";
- (BOOL) iCloudIsAvailable
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *ubiquityURL = [fileManager URLForUbiquityContainerIdentifier:UbiquityContainerIdentifier];
return (ubiquityURL) ? YES : NO;
}
However, I've found that calling URLForUbiquityContainerIdentifier:
might take time (several seconds) the very first time within a session. So, just make sure you call this in the background to not block the UI temporarily:
dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(backgroundQueue,^{
BOOL isAvailable = [self iCloudIsAvailable]
/* change to the main queue if you want to do something with the UI. For example: */
dispatch_async(dispatch_get_main_queue(),^{
if (!isAvailable){
/* inform the user */
UIAlertView *alert = [[UIAlertView alloc] init...]
[alert show];
[alert release];
}
});
});
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