getMessageReceiptDetails method

void getMessageReceiptDetails ({@required dynamic target, @required String msgId, @required JMCallback callback })

Implementation

void getMessageReceiptDetails({
  @required dynamic target, /// (JMSingle | JMGroup)
  @required String msgId,
  @required JMCallback callback,
}) async {
  print(flutter_log + "getMessageUnreceiptCount" + " msgid = $msgId");

  if (msgId == null || msgId.length == 0 || target == null) {
    callback(null,null);
    return ;
  }

  Map param = target.toJson();
  param["id"] = msgId;

  Map resultMap = await _channel.invokeMethod('getMessageReceiptDetails', param..removeWhere((key,value) => value == null));
  if (resultMap != null) {
    List receiptJosnList    = resultMap["receiptList"];
    List unreceiptJosnList  = resultMap["unreceiptList"];

    List<JMUserInfo> receiptUserList    = receiptJosnList.map((json) => JMUserInfo.fromJson(json)).toList();
    List<JMUserInfo> unreceiptUserList  = unreceiptJosnList.map((json) => JMUserInfo.fromJson(json)).toList();
    callback(receiptUserList,unreceiptUserList);
  }else{
    callback(null,null);
  }
}