livekit / client-sdk-react-native

Official React Native SDK for LiveKit.
https://livekit.io
Apache License 2.0
117 stars 30 forks source link

Ping timeout in background #40

Open davidliu opened 1 year ago

davidliu commented 1 year ago

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.

MfaXyz commented 1 year ago

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

yevhenlv commented 8 months ago

It doesn't work on ios, app terminated