birdofpreyru/react-native-static-server

Server died in sleep mode

Closed this issue · 2 comments

On iOS, whenever I turn off screen of my device, I can’t connect to the server anymore, even getActiveServerId return non null value

How to reproduce (I’m using rn 0.72)

  • Start nonLocal:true server on physical ipad
  • Connect from PC
  • Turn the screen off on ipad
  • Refresh the page on the PC

I expect the server keeps running or should restart or throws a state change but it doesn’t

Hey @triracle97 , I never tried to run it in the background, and early on I got an impression it might not work across staying in the background, if not restarted after returning into the foreground, thus so far I always use stopInBackground option in my apps myself.

My first guess is, it probably needs correct background execution modes configured to be able to stay alive in / across the phone falling asleep. Do you have that configured for your app?

Thank you! Running in foreground is enough for me, can close the issue here.