Prevent iCloud backup of Phonegap's localstorage

published Oct 07, 2013 06:50   by admin ( last modified Oct 08, 2013 01:08 )

In a defalt setup in Phonegap 2.8.1, localstorage is marked for backup to iCloud. This may get your app rejected by Apple, depending on the size.

To disable backups, set BackupWebStorage to "none" or "local" in the "config.xml" file. The config.xml file is located in your <project folder>/<appname> directory.

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

BackupWebStorage (string, defaults to cloud): valid values are none, cloud and local.

Verify

To check that it works, Apple recommends this way to check how much data you have put under the auspices of iCloud:

  • Install and launch your app
  • Go to Settings > iCloud > Storage & Backup > Manage Storage
  • If necessary, tap "Show all apps"
  • Check your app's storage

Do note, that this cannot be done in a simulator. You need a real device.