eclipsesource / tabris-js

Create native mobile apps in JavaScript or TypeScript.
https://tabrisjs.com
BSD 3-Clause "New" or "Revised" License
1.4k stars 170 forks source link

Provide a way to disable app data cloud backup #1660

Open cpetrov opened 6 years ago

cpetrov commented 6 years ago

Problem description

Currently, on Android, one can disable cloud backup by setting AndroidManifest.xml application's attribute android:allowBackup to "false" (see https://developer.android.com/guide/topics/data/autobackup#EnablingAutoBackup) by including the following in config.xml:

  <widget ... xmlns:android="http://schemas.android.com/apk/res/android" />
  <edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
    <application android:allowBackup="false" />
  </edit-config>

On iOS, the localStorage implementation is based on a Documents file, which is automatically backed up (see https://developer.apple.com/icloud/documentation/data-storage/index.html) and this behavior cannot be configured.

Expected behavior

Tabris.js should provide API to disable backup for app storages on iOS. See native API.

patrykmol commented 6 years ago

One way to approach this is to give developer an API that would allow him to set NSURLIsExcludedFromBackupKey flag. The other way would be to use Cache directory which is never backed up. This would also mean that we need to give the developer ability to choose between storing files in Documents or Cache directory. I think we could do both in long run but as an immediate solution I would propose the first one.

cookieguru commented 6 years ago

BackupWebStorage preference?