react-native-agora icon indicating copy to clipboard operation
react-native-agora copied to clipboard

onUserOffline No callback triggered

Open mzyisbest opened this issue 9 months ago • 6 comments

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.

mzyisbest avatar May 16 '24 03:05 mzyisbest

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

guoxianzhe avatar May 20 '24 09:05 guoxianzhe

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

liylmn avatar May 23 '24 10:05 liylmn

+1

mzyisbest avatar May 28 '24 07:05 mzyisbest

@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.

guoxianzhe avatar Jun 03 '24 02:06 guoxianzhe

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({}); } }

premj-ekah avatar Jun 24 '24 11:06 premj-ekah

@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

guoxianzhe avatar Jun 25 '24 02:06 guoxianzhe

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.

stale[bot] avatar Aug 24 '24 02:08 stale[bot]