使用消息平台发送业务消息方法Demo

消息接口调用Demo:
/// <summary>
/// 消息平台发消息通知用户Demo
/// </summary>
/// <param name="ctx">上下文</param>
private void sendMessage(Context ctx)
{
NormalTextSendMessageInfo normalTextMessageInfo = new NormalTextSendMessageInfo();
//定义消息级别: 1-提醒 2-警告 3-紧急
normalTextMessageInfo.Level = 1;
//定义接受人的集合传入用户ID的数组(下面例子是通知当前操作用户和系统管理员)
HashSet<long> lstReciverIds = new HashSet<long>();
lstReciverIds.Add(ctx.UserId);
lstReciverIds.Add(FormConst.AdministratorID);
normalTextMessageInfo.ReceiverIds = lstReciverIds.ToArray();
//定义发送人的ID
normalTextMessageInfo.SenderId = ctx.UserId;
//定义标题内容
normalTextMessageInfo.Title = "消息标题";
//定义消息类型:1-业务消息 2-预警消息 3-运营消息 4
使用消息平台发送业务消息方法Demo
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。



