Download file on application open

#1

I need my app to download some files from my CDN when it’s launched or open. Pretty much like Expo OTA update mechanism works (and I’ll actually include a version of those files in the published packages) but OTA requires the app publish. And I want to have a batch process to push a new version of the files relatively often, potentially multiple times per day. It’s totally fine for an app to have stale versions of these files, but they should get updated in a 1-2 days assuming a user uses the app daily. I have all these complications due to Firebase not providing a flexible query language and the dataset is not big and can be downloaded and stored on the device.

Is there a way to nicely do that in Expo, potentially re-using OTA mechanisms?

#2

I think you can do is just use fetch in your application to download the files unless I’m misunderstanding.

You could use setInterval or something if you wanted to repeatedly trigger a fetch to happen.

#3

Exactly, many mobile apps need to do that so I was wondering if there is something embedded in Expo, but in regards of scheduling and checking if resource has changed. setInterval is one option, thanks. Another is to simply check on startup and do similar things that Expo.Updater does.

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.