4

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!

Sir Hackalot
  • 521
  • 6
  • 16
  • Do you have any plugins installed that relate to cloud storage? If so, the plugin could be adding that setting and then you would need to check the `plugin.xml` file for that plugin and make the change there – Dawson Loudon Jan 08 '15 at 15:27
  • Not that I am aware of. I'm only using those standard cordova plugins (device, camera, media-capture, file, file-transfer, and console). – Sir Hackalot Jan 08 '15 at 23:45

1 Answers1

5

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)

Sir Hackalot
  • 521
  • 6
  • 16