client-sdk-react-native icon indicating copy to clipboard operation
client-sdk-react-native copied to clipboard

Ping timeout in background

Open davidliu opened this issue 3 years ago • 2 comments

Describe the bug Websocket client signal disconnected when react-native APP based on RN sdk goes from Android PIP(picture in picture) mode to normal mode after 20 seconds. From our debugging, it is caused by the ping time out. So our theory is: when APP goes to Android PIP mode, the RN has gone into background mode, and the ping is not working, when RN goes back from PIP mode to normal, it times out then triggers disconnect.

Additional context setTimeout and setInterval don't work in the background. Need to figure out workaround to avoid the need for these or work in background.

davidliu avatar Jan 04 '23 08:01 davidliu

Hello, try these packges: https://github.com/ocetnik/react-native-background-timer https://notifee.app/react-native/docs/android/foreground-service

MfaXyz avatar Jan 08 '23 16:01 MfaXyz

It doesn't work on ios, app terminated

yevhenlv avatar Jan 30 '24 11:01 yevhenlv