Sqlstorage backup flags

Hi all, I’m hoping someone can shed any light on how backupFlag option for the sqlStorage works and what this means for the user, the documentation is a little light:


From the documentation it sounds like there are 3 options:

  • BACKUP_LOCAL > suggests data is not stored in the iCloud (but perhaps as part of someones device backup?)

My question is, I would like the app to store data in the end users iCloud so if a device is wiped/lost they can recover the app data - is that possible, what’s the different in the options available?

It would also be great if storing in the iCloud would allow data to be synced across devices but I don’t know if it’s that simple or if some kind of sync/diff of the db is required.

Any pointers on this would be great… it’s not super critical but for anyone who has lost/restored their phone in the past, having an app do this is really handy.

The Cordova SQLite plugin README has some more detail. The way I read it, what you “would like the app to do” is explicitly prohibited by Apple’s guidelines (although I have no idea whether the App Store would reject simply based on this).

Thanks @rapropos. That was the impression I got when reading about Apple locking down iCloud backups. I guess the three options provided through the backupFlag are simply so you can change the location but make no difference in terms of iCloud storage?

I don’t think I can describe it better than the plugin docs do, but the way I read it, BACKUP_DOCUMENTS would go to iCloud (and presumably incur Apple’s wrath).

I’m hoping that the app data will be backed up on the iCloud as part of the device backup (when I look at my device backup on the iCloud, a lot of apps are listed there - need to try doing a restore from backup to be sure). Otherwise, surely Apple hasn’t made it impossible to backup an apps data in some form.

I’m not comfortable speaking for Apple, but there doesn’t seem to be a whole lot of room for interpretation in “a SQLite database’s store file must never be stored in iCloud”.

haha no, I think they make it quite clear :slight_smile: thanks for your thoughts though! It’s good to know someone else interprets it the same as myself - in short not much you can do to save the user from loosing their data unless it’s saved as part of the actual device backup (one for me to test I guess).