Data backups to users iCloud/Google Drive API
Maximilian Krause
While this would be great to have as an Expo module out of the box, we have just released a library that does exactly this and includes an Expo config plugin so it can be used with Expo managed workflow (development client / EAS required). It supports both iCloud and Google Drive.
It's still pretty sparse (we've implemented the features we were looking for ourselves in an app project) but we're open to feature requests.
https://github.com/Kuatsu/react-native-cloud-storage
J
Josh Reyes
Hey all any updates to this? iCloud backup is very necessary for a project I'm working on
Fred Rivett
I'd love to be able to use backups to iCloud, it seems possible with a line change with the
AsyncStorage
React Native package that Expo uses, changing RCTAsyncStorageExcludeFromBackup
to NO
, but this requires ejecting, would be amazing if Expo exposed this so we could set this without ejecting:Michael Wood
Fred Rivett: Have you tried putting that into your
app.json
? https://docs.expo.dev/versions/latest/config/app/#infoplistOr does it get overridden?
If the above doesn't work then it should still be possible via a simple config plugin as long as you build with EAS Build.
Fred Rivett
Michael Wood: Hey Michael, thanks for the reply here! I haven't tried that, wasn't aware of that option, I should have found that in my searching but didn't for some reason. I'll try that soon and report back here.
shubham goyal
By any chance did You get any solution to this as i have been struggling for a while to backup the database of user mostly sqlite to the iCloud or Google Drive
Jón Arason
You can already utilize the Google Drive API with fetch() or creating your own XMLHttpRequest, but you'll quickly run out of luck with large files, since Expo lacks good Blob support.
Giau. Tran Minh
Jón Arason: No, Blob request was supported by react-native vanilla, so Expo supported too.
Jón Arason
Giau. Tran Minh: Indeed, but it's very limited at the moment in Expo. There doesn't seem to be any way to get the blob of a file without XMLHttpRequest, which crashes with large blobs that are over 400 MB. If you want to upload large files then you'll need to eject and use rn-fetch-blob. I've created a feature request for better blob support.