Ios application, which is not automatically backed up to iCloud

Source: Internet
Author: User

Ios application, which is not automatically backed up to iCloud

Original article, reprinted please indicate the source

For ios projects, if you have built-in downloads or programs that dynamically generate files, pay attention to the downloaded or generated files. Do you want to automatically back up the files to iCloud?

If you do not have a proper reason to automatically upload large files, you may not be able to pass the application review and receive a reply similar to this.

We also found that your app does not follow the iOS Data Storage Guidelines, which is required per the App Store Review Guidelines.

For example someone encounters the same problem http://stackoverflow.com/questions/16239147/ios-do-not-back-up-attribute

Apple's setting method: Official Document https://developer.apple.com/Library/ios/qa/qa1719/_index.html

The Code is as follows:

#define DownLoad_Directory "Download_Dir"#pragma mark Download_Dirvoid DeviceClass::initDownloadDir(){    string l_strDocumentDir = cocos2d::CCFileUtils::sharedFileUtils()->getWritablePath();    l_strDocumentDir.append(DownLoad_Directory);        NSString* l_strDownloadDir = [NSString stringWithUTF8String:l_strDocumentDir.c_str()];    NSError* l_error;    if (![[NSFileManager defaultManager] fileExistsAtPath:l_strDownloadDir]){        [[NSFileManager defaultManager] createDirectoryAtPath:l_strDownloadDir withIntermediateDirectories:NO attributes:nil error:&l_error]; //Create folder                // exclude downloads from iCloud backup        NSURL *url = [NSURL fileURLWithPath:l_strDownloadDir];        if(strcmp(g_systemVersion.c_str(), "5.1") >=0 ){            if ([url setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&l_error] == NO) {                NSLog(@"Error: Unable to exclude l_strDownloadDir from backup: %@", l_error);            }        }    }        //this->setDonotBackupInICloud();}
Create a new folder in the writable directory to store the downloaded file (if necessary, the automatically generated file will also be placed here), and mark that the directory will not be uploaded to iCloud

Thank you for your reminder.


Test method:

Set-> iCloud-> Manage storage space-> Backup (select a device if multiple devices exist)

If there are many applications, click "show all applications" to check the total capacity of your application and back up the content on iCloud.

When you open and close this interface, you will find that the backup mwjg capacity of your application on iCloud is the same.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.