sendInviteMsgToCallee method

Future<void> sendInviteMsgToCallee(
  1. String userId,
  2. ChatCallKitCallType type,
  3. String callId,
  4. String channel,
  5. Map<String, String>? ext,
)

Implementation

Future<void> sendInviteMsgToCallee(String userId, ChatCallKitCallType type,
    String callId, String channel, Map<String, String>? ext) async {
  String sType = 'voice';
  if (type == ChatCallKitCallType.multi) {
    sType = 'conference';
  } else if (type == ChatCallKitCallType.video_1v1) {
    sType = 'video';
  }
  final msg = ChatMessage.createTxtSendMessage(
      targetId: userId, content: 'invite info: $sType');
  Map attr = {
    kMsgType: kMsgTypeValue,
    kAction: kInviteAction,
    kCallId: callId,
    kCallType: type.index,
    kCallerDevId: model.curDevId,
    kChannelName: channel,
    kTs: ts
  };
  if (ext != null) {
    attr[kExt] = ext;
  }

  msg.attributes = attr;
  ChatClient.getInstance.chatManager.sendMessage(msg);
  chatLog("sendInviteMsgToCallee", msg);
}