Beispiel #1
0
        /// <summary>
        /// 方法说明:通过SDK发送自定义消息接口:[支持4000-9999的自定义消息,仅仅是传输][完成自定义消息(MsCustomEntity)中的content内容]
        /// 完成时间:2017-05-16
        /// </summary>
        /// <param name="entity">发送消息实体</param>
        /// <param name="custommsgType">自定义消息类型[4000-9999]</param>
        /// <param name="customTopic">自定义主题</param>
        /// <param name="errorMsg">提示信息</param>
        /// <returns>是否成功发送消息</returns>
        public bool SdkPublishCustomMsg(MsSdkCustomEntity entity, int custommsgType, string customTopic,
                                        ref string errorMsg)
        {
            var jsonStr = MsgConverter.GetJsonByCustomMsg(entity, custommsgType.ToString(), ref errorMsg);

            return(!string.IsNullOrEmpty(jsonStr) && Publish(customTopic, jsonStr, false, ref errorMsg));
        }