/// <summary> /// 方法说明:通过SDK发送自定义消息接口:[支持4000-9999的自定义消息已读/收回执,仅仅是传输][完成自定义消息(MsCustomEntity)中的content内容] /// 完成时间:2017-05-16 /// </summary> /// <param name="sendReceipt">已读/收回执实体</param> /// <param name="receiptType">已读/收类型</param> /// <param name="customTopic">自定义消息主题</param> /// <param name="errorMsg">提示信息</param> /// <returns>是否成功发送消息</returns> public bool SdkPublishCustomReceiptMsg(SdkMsSendMsgReceipt sendReceipt, SdkReceiptType receiptType, string customTopic, ref string errorMsg) { var jsonStr = MsgConverter.GetJsonByMsgReceipt(sendReceipt, ref errorMsg); var topic = receiptType == SdkReceiptType.ReadReceipt ? TopicSend.sdk_read.ToString() : TopicSend.sdk_receive.ToString(); return(!string.IsNullOrEmpty(jsonStr) && Publish(topic, jsonStr, false, ref errorMsg)); }
/// <summary> /// 方法说明:获取SDK回执发送实体 /// </summary> /// <returns>SDK回执发送实体</returns> internal SdkMsSendMsgReceipt GetSdkSend() { var antsdkreceivemsgtypeValue = (long)MsgType; var sdkreceivemsgType = (SdkMsgType)antsdkreceivemsgtypeValue; var sdkSend = new SdkMsSendMsgReceipt { MsgType = sdkreceivemsgType, sessionId = sessionId, chatIndex = chatIndex, userId = userId, attr = attr, }; return(sdkSend); }