onUserOffline property

void Function(RtcConnection connection, int remoteUid, UserOfflineReasonType reason)? onUserOffline
final

Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel.

There are generally two reasons for users to become offline: Leave the channel: When a user/host leaves the channel, the user/host sends a goodbye message. Drop offline: When no data packet of the user or host is received for a certain period of time (20 seconds for the communication profile, and more for the live broadcast profile), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections. It is recommended to use the Agora RTM SDK for reliable offline detection.

  • connection The connection information. See RtcConnection.
  • remoteUid The ID of the user who leaves the channel or goes offline.
  • reason Reasons why a remote user (in the communication profile) or host (in the live streaming profile) goes offline. See UserOfflineReasonType.

Implementation

final void Function(RtcConnection connection, int remoteUid,
    UserOfflineReasonType reason)? onUserOffline;