My React Native (Android) application sends requests to the server when some events are triggered. But when I lock phone screen and in a few minutes event is triggered, app try to send request, but it fails. I tried fetch
(error Network request failed
) and XMLHttpRequest
.
On some devices it works fine and I can't understand it depends on Android version or on device model.
Why does it happen and why on some (not all) devices? How can I fix it? Thanks!