benjreinhart / react-native-aws3

Pure JavaScript React Native library for uploading to AWS S3
MIT License
399 stars 151 forks source link

Upload in the background? #22

Closed proProbe closed 7 years ago

proProbe commented 7 years ago

Hello and thanks for the awesome library! Im currently trying out the library and noticed some peculiar things. It appears that the library doesnt really allow upload in the background. Maybe Im incorrect on this?

On IOS, the upload stops as soon as you actually turn off the phone (notice turn off and NOT killing the phone). If you just close down the app and derp around in your phone, the upload does not stop.

On Android, the upload acually continues when you turn off the phone and also when you close down the app.

Does any of this ring any bell or is it intended?

benjreinhart commented 7 years ago

Hey proProbe,

It is true that I have not done anything to explicitly allow for uploading in the background. The behavior of a currently open request when the app is in the background is not something I have considered. The closest thing that is supported to controlling a request's status is the progress and abort methods on the returned "promise-like" object from this lib.

For any more information, you'll have to take a look at the behavior of RN's XMLHttpRequest library, as that is what this library delegates to for handling requests.

proProbe commented 7 years ago

hey @benjreinhart! thanks for the quick answer. I will look into that. Just out of curiosity, is adding background upload/downloads in the pipeline for the near future? It seems like a use-case that most apps would love to have. Waiting in the app for a somewhat larger file to upload would not be preferred

benjreinhart commented 7 years ago

It is not in the pipeline from my perspective given I have been using this for small files, but I welcome any/all solid PRs!