Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

preference BackupWebStorage reset to default after cordova build

This is my first cordova-based iOS app (using cordova 4.1.2).

I want to deactivate web storage being backed up to the cloud by setting <preference name="BackupWebStorage" value="none" /> in /Staging/config.xml.

However, after doing a cordova build the preference is reset to its default value "cloud".

So I tried setting the preference in the config.xml file that is located in the project root instead. But this just adds a second BackupWebStorage preference (correctly set to "none") but does not replace the generated preference in /Staging/config.xml which is still set to "cloud". So two BackupWebStorage preference in the same file - not good.

After searching through the web I found out that file.setMetadata with com.apple.MobileBackup set to 1 deactivates cloud backup for each individual file it is called for. Maybe this is the way to go.

But still, I'd like to know, if there is a persistent way to set BackupWebStorage preference to "none" so that it will not be reset to "cloud" after a rebuild.

Thanks for your help!

like image 592
Sir Hackalot Avatar asked Oct 14 '25 13:10

Sir Hackalot


1 Answers

BackupWebStorage is a platform-specific preference so in your root config.xml it needs to be specified within the platform tag in order to be placed into the right platform-specific config.xml when doing a cordova build.

Example:
Put this into the root config.xml

<platform name="ios"> 
  <preference name="BackupWebStorage" value="none" /> 
</platform>

to make this the actual BackupWebStorage preference setting within the ios config.xml.

See https://cordova.apache.org/docs/en/4.0.0/config_ref_index.md.html (bottom of page)

like image 65
Sir Hackalot Avatar answered Oct 17 '25 17:10

Sir Hackalot