Vydia / react-native-background-upload

Upload files in your React Native app even while it's backgrounded. Supports Android and iOS, including camera roll assets.
MIT License
723 stars 330 forks source link

Reacting to completed event while in background #228

Open r3r00t3d opened 3 years ago

r3r00t3d commented 3 years ago

Hi, thanks again for the very useful library that you're supporting. My question is, is there a possibility for a library to react when the process of uploading the file is completed?

Typical scenario would be that the user starts the upload, backgrounds the application, then opens e.g. Chrome and browses the web during which the upload is complete. I'm not sure on how this is even handled since JS thread is effectively suspended when the app goes in to the background. In that case, I cannot see how I can catch completed event. Maybe you have some ideas.

bneigher commented 3 years ago

I have a job scheduler that runs background tasks. That way if files fail to upload, they will be uploaded at a later time in the background. check out https://github.com/transistorsoft/react-native-background-fetch