AgoraIO-Extensions / react-native-agora

React Native around the Agora RTC SDKs for Android and iOS agora
https://www.agora.io
MIT License
620 stars 227 forks source link

onUserOffline No callback triggered #786

Closed mzyisbest closed 23 hours ago

mzyisbest commented 3 months ago

I'm on a call between ios and android. During the call, the ios side kills the process, and the other side's Android side has a callback onUserOffline. But when android kills the process, there is no callback on onUserOffline on the IOS side.

guoxianzhe commented 3 months ago

@mzyisbest This is due to system differences. When a user on the Android platform leaves, other users may receive the onUserOffline notification relatively slowly.

liylmn commented 3 months ago

@guoxianzhe The callback hasn't been triggered yet, it's not slow

mzyisbest commented 3 months ago

+1

guoxianzhe commented 3 months ago

@mzyisbest @liylmn Maybe triggers "timeout offline". If the user does not receive any data packets from the other party within a certain time frame (20 seconds for communication scenarios, slightly delayed for live scenarios), it is determined that the other party is offline. In case of poor network conditions, there is a possibility of false alarms. It is recommended to use the Netease Signaling SDK for reliable offline detection.

premj-ekah commented 2 months ago

It seems the issue is due to the below code segment in internal/RtcEngineExInternal.ts. If there is atleast one event handler of any type already registered, it does not register the other event handlers. So if there is event handler for onUserJoined it will not register event handler for onUserOffline.

if ( checkers.IRtcEngineEventHandler?.strictTest({ [eventType]: undefined }) ) { if (RtcEngineExInternal._event_handlers.length === 0) { this.registerEventHandler({}); } }

guoxianzhe commented 2 months ago

@premj-ekah This is not the registration of controlling IRtcEngineEventHandler. The registration of IRtcEngineEventHandler is done through _event_handlers. So, if you register onUserJoined and onUserOffline both, it still can trigger normally

stale[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.