Support option not to back up local storage to iCloud
-----------------------------------------------------
Key: CB-522
URL: https://issues.apache.org/jira/browse/CB-522
Project: Apache Callback
Issue Type: Improvement
Components: iOS
Affects Versions: 1.6.0
Reporter: Jacob G
Assignee: Shazron Abdullah
Fix For: 1.6.1
In 1.6.0, PhoneGap/Cordova implemented a workaround for an iOS 5.1 bug dealing
with local storage persistence by copying the local storage cache file to a
persistent folder. This workaround results in the local storage file to
automatically be backed up to iCloud. Developers may not want this file backed
up to iCloud is certain scenarios (such as device uniqueness), and there should
be an option to not back up to iCloud but yet still maintain persistent
integrity on that device.
In code, this can be accomplished by the following:
// Mark Documents folder with special attribute to tell iOS not to
back up to iCloud.
const char* cstr = [documentsDirectory UTF8String] ;
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(cstr, attrName, &attrValue,
sizeof(attrValue), 0, 0); // 0 is success, -1 is failure
if(result != 0){
NSLog(@"Error: Documents folder could not be set to not backup
to iCloud");
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira