Browse SDKs · Flutter
SDKsFlutterEnterprise

Handle call events

Configure the Flutter SDK call-signaling listener in one place.

Copy

Configure OnSignalingListener once when initializing the application's call module:

Future<void> registerCallListener() {
  return OpenIM.iMManager.signalingManager.setSignalingListener(
    OnSignalingListener(
      onReceiveNewInvitation: handleIncomingCall,
      onInviteeAccepted: handleInviteeAccepted,
      onInviteeRejected: handleInviteeRejected,
      onInvitationCancelled: handleInvitationCancelled,
      onInvitationTimeout: handleInvitationTimeout,
      onInviteeAcceptedByOtherDevice: handleAcceptedElsewhere,
      onInviteeRejectedByOtherDevice: handleRejectedElsewhere,
      onHangup: handleHangup,
      onRoomParticipantConnected: handleParticipantConnected,
      onRoomParticipantDisconnected: handleParticipantDisconnected,
      onStreamChange: handleStreamChange,
    ),
  );
}

This page is the sole complete owner of these 11 non-custom signaling callbacks. Merge invitation events by SignalingInfo.invitation.roomID. For participant and media-stream state, use both RoomCallingInfo.roomID and the user ID.

SignalingManager retains only one listener, so a later call replaces the previous instance. The pinned SDK does not expose a removal method. When switching accounts, stop writing events into the old account's state and replace the listener with the complete instance for the new account.