Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

request failed when power button pressed or screen off automatically in IOS (only happens with real device)

$
0
0

I tried react native fetch and also with axios get and response from a server which may take a while to respond and pressed power key to put screen off. then power key pressed again to wake up mobile and unlocked and we have network error. this also happens when the screen automatically gets sleep while request in progress. I checked with android and this issue not exist with android. and even not with IOS emulators.

steps to reproduce:

  1. make a simple project with REST API call.
  2. add some delay from the server-side to above API.
  3. Run App on real device and call API.
  4. put screen off by press power key and unlock again.

now request will fail with a network error. is there any solution for this


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>