コード例 #1
0
 public SenderRet Send(PushChannelModel channel, PushMsgModel msg)
 {
     if (channel.SystemType == SystemTypeEnum.Android || msg.SystemType == SystemTypeEnum.Android)
     {
         return(UniCast.SendMessage(channel, msg));
     }
     return(new SenderRet()
     {
         IsSuccess = false, Code = "-1", Msg = "华为推送通道只支持android"
     });
 }
コード例 #2
0
        public static SenderRet SendMessage(PushChannelModel channel, List <PushMsgModel> msgList)
        {
            List <SenderRet> senderRetList = new List <SenderRet>();

            foreach (var msg in msgList)
            {
                SenderRet ret = UniCast.SendMessage(channel, msg);
                ret.Id = msg.Id;
                senderRetList.Add(ret);
            }
            return(new SenderRet {
                IsSuccess = true, ResultList = senderRetList
            });
        }