Hi, it would be nice if you could update the documentation to include information about whether AsyncStorage data is stored and restored in iCloud and android backups, and what configuration steps might be necessary for this (i.e. android manifest android:fullBackupContent etc.)
see Motivation
Good idea. On iOS, AsyncStorage saves the data to the file, that's accessible for user to look into. There's a feature request that allows you to change the default save location. We'd have to keep this in mind if we were to write docs about it.
I would really appreciate that! Is there any information already somewhere how to properly backup and restore AsyncStorage data?
@zwenza
Here are Android docs regarding auto backup (Android 23+). Haven't tested it against AsyncStorage though.
<include domain="database" path="RKStorage" /> in it or at least no analog <exclude> tag, which for some reason was auto-generated for me by android studio.adb shell bmgr backupnow your.package and other commands at https://developer.android.com/guide/topics/data/testingbackup.html@mo22
Is there any way to opt-out of auto-backup feature in iOS?. In android changing android:allowBackup="false" does it. Anything similar in iOS? I have a privacy concern and need to clear the app data on uninstall.
I don't think there's an built-in way.
You could use https://github.com/mo22/react-native-mo-fs and manually set the backup attribute for the storage directory.
Fs.ios.Module.setResourceValues('file:///path/to/file', {
'NSURLIsExcludedFromBackupKey': true,
});
@nishantpillai5
Related issue. I'll come up with solution in upcoming days
We'll in the latest version one by default opts out of backups. However I'm wondering how everyone else managed to get app data backed up in the first place?
I've tried with 0.13 and pre 0.13 releases - our app data never gets saved in the cloud. Do I need to enable some capabilities?
We use redux and redux-persist and redux-persist stores the data using async storage. I've downloaded the appData from the phone and I can see that the async files are stored inside of the Docs folder. So I don't understand how everyone else managed to back up the data in the cloud and I didn't :)
We'll in the latest version one by default opts out of backups. However I'm wondering how everyone else managed to get app data backed up in the first place?
Devs were raising concern that might be the happening in some cases for their users. I could not repro this myself, but went ahead and added a this as a feature toggle, off by default.
Here is the documentation about it
https://react-native-async-storage.github.io/async-storage/docs/advanced/backup
@Krizzu - I saw those docs. I was actually asking - how do you force AsyncStorage to store the data in iCloud? We've set the RCTAsyncStorageExcludeFromBackup to false, but our data is never uploaded to icloud. How does one configure an app to upload the data? Is there something in XCode that needs to be configured? I added iCloud as capability in it, but our data never left the device...
Most helpful comment
Android:
<include domain="database" path="RKStorage" />in it or at least no analog<exclude>tag, which for some reason was auto-generated for me by android studio.adb shell bmgr backupnow your.packageand other commands at https://developer.android.com/guide/topics/data/testingbackup.htmlIOS: