简体   繁体   中英

How to disable iCloud in iOS 7 App

Currently my iOS application supports iCloud backup and for that my application got rejected from App Store.I have disabled the iCloud option in capabilities tab of target section in Xcode but still my application supports iCloud backup.

To check this, if i go to Settings -> iCloud -> Storage & Backup -> Manage Storage ->Check your app's storage in my device i clould see backup for my application happens.

Now the question is i don't want my application to come under the above mentioned path(that means i want to disable the iCloud back up for my application). If i can accomplish this then i can assure that my application is not supporting iCloud backup.

What code or setting i should do show that it will work for me.

Thanks in advance.

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL {

assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);

NSError *error = nil;
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
                              forKey: NSURLIsExcludedFromBackupKey error: &error];
if(!success){
    NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
}
return success; }

Pass your file url to this function. This will prevent files to backup on iCloud

在此处输入图片说明 Please OFF the iCloud from Capablities

Target -> Capablities - > iCloud -> OFF

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM