initializeRtm method

Future<void> initializeRtm(
  1. AgoraRtmClientEventHandler agoraRtmClientEventHandler
)

Function to initialize the Agora RTM client.

Implementation

Future<void> initializeRtm(
    AgoraRtmClientEventHandler agoraRtmClientEventHandler) async {
  value = value.copyWith(
    agoraRtmClient: await AgoraRtmClient.createInstance(
      value.connectionData!.appId,
    ),
  );
  if (value.agoraRtmClient != null) {
    addListener(() {
      createRtmClientEvents(agoraRtmClientEventHandler);
    });
  }
}