sendContactMessage method

  1. @override
Future<String> sendContactMessage(
  1. List<String> contactList,
  2. String jid,
  3. String contactName,
  4. String replyMessageId, {
  5. String? topicId,
})
override

This method is used to send the contact message.

Implementation

@override
Future<String> sendContactMessage(List<String> contactList, String jid,
    String contactName, String replyMessageId,
    {String? topicId}) async {
  String? contactResponse;
  try {
    contactResponse =
        await mirrorFlyMethodChannel.invokeMethod('sendContactMessage', {
      "contact_list": contactList,
      "jid": jid,
      "contact_name": contactName,
      "replyMessageId": replyMessageId,
      "topicId": topicId
    });
    return convertChatMessageJsonFromString(contactResponse);
  } on PlatformException catch (e) {
    LogMessage.d("Platform Exception =", " $e");
    rethrow;
  } on Exception catch (error) {
    LogMessage.d("Exception ", " $error");
    rethrow;
  }
}