Original articles, reproduced please indicate the source
iOS project, if you have a built-in download or program dynamically generated files, you should pay attention to the downloaded or generated files, do not proactively back up to icloud
Assuming you don't have the right reasons to upload large files yourself, you might not be able to pass an app audit. Received a reply like this
We also found that your app does not follow the IOS Data Storage guidelines, which is required per the app Store Review Gu Idelines.
For example, someone encounters the same problem Http://stackoverflow.com/questions/16239147/ios-do-not-back-up-attribute
Apple gives the Setup method: Official Document Https://developer.apple.com/Library/ios/qa/qa1719/_index.html
Applied to the project, detailed code such as the following
#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] CreateDirectory Atpath:l_strdownloaddir Withintermediatedirectories:no Attributes:nil error:&l_error]; Create folder//exclude downloads from ICloud backup nsurl *url = [Nsurl Fileurlwithpath:l_strdow Nloaddir]; if (strcmp (G_systemversion.c_str (), "5.1") >=0) {if ([url setresourcevalue:[nsnumber numberwithbool:yes] for Key:nsurlisexcludedfrombackupkey Error:&l_error] = = NO) {NSLog (@ "error:unable to exclude L_strdownloa Ddir from backup:%@ ", l_error); }}}//this->setdonotbackupinicloud ();}
is to create a new folder under the Writable folder, store the download file (if necessary, your own active files are also placed here), and mark the folder will not be uploaded to icloud
Thank Mei Jun colleagues for their reminders
Test method:
Set up->icloud-> management storage (if you have multiple devices, select devices)
For more apps, click "Show All Apps" to find your app and back up the total capacity of your content on icloud.
By opening and closing this interface, you will find that your app's backup MWJG capacity on icloud is not the same.
iOS apps, set up to not proactively back up to icloud