Ejemplo n.º 1
0
    public static void MsgBatchSend()
    {
        MsgBatchSendParam param   = new MsgBatchSendParam();
        string            user_id = "287646";
        List <string>     userids = new List <string>();

        userids.Add(user_id);
        Message message = new Message();
        Elem    elem    = new Elem();

        elem.elem_type         = TIMElemType.kTIMElem_Text;
        elem.text_elem_content = "批量发";
        List <Elem> elem_list = new List <Elem>();

        elem_list.Add(elem);
        message.message_elem_array = elem_list;
        param.msg_batch_send_param_identifier_array = userids;
        param.msg_batch_send_param_msg = message;

        TIMResult res = TencentIMSDK.MsgBatchSend(param, addAsyncDataToConsole);

        Utils.Log(((int)res).ToString());
        addDataToConsole(res);
    }
Ejemplo n.º 2
0
        /// <summary>
        /// 群发消息
        /// </summary>
        /// <param name="msg">群发消息</param>
        /// <param name="handler">群发消息成功与否的回调</param>
        public static TIMResult IMTIMMsgBatchSend(MsgBatchSendParam msg, MsgBatchSendDelgate handler = null)
        {
            var ptr = DelegateConverter.ConvertToIntPtr(handler);

            return((TIMResult)TIMClientAPIDef.TIMMsgBatchSend(JsonConvert.SerializeObject(msg), MsgBatchSendDelgateResultCallBack, ptr));
        }