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
735 stars 335 forks source link

[Enhancement] Switch Upload from Cellular to WiFi when a WiFi network is joined during an upload #127

Open pedrosimao opened 5 years ago

pedrosimao commented 5 years ago

I have noticed that if an upload starts via 4G or 3G connection and the user connects to a WiFi during the upload, the upload won't switch to Wifi (which would be normally faster and cheaper). But it stays on cell network till the end. It would be great to create a listener for cell network to wifi network changes, so upload could switch network or even restart.

pedrosimao commented 5 years ago

@TSMMark thanks for your support. If you have any idea on how it can be done I can try to code it myself.

TSMMark commented 5 years ago

I imagine it would have to be implemented for iOS and Android both separately because of the nature of background processes. Looking into it more I'm not sure it would even be possible without canceling and retry an upload once the device has switched networks, and it sounds like it would require foregrounding the app. https://forums.developer.apple.com/thread/25758

Sorry I can't be of more help. Your best bet might be allowing the user to cancel and retry within your application