Beispiel #1
0
        /// <summary>
        /// 生成一个IOS的通知
        /// </summary>
        /// <param name="pType">类型:1-直接发送,其它放入数据库轮循</param>
        /// <param name="pChannelID">对应MessageChannel表中的ID</param>
        /// <param name="pDeviceToken"></param>
        /// <param name="pMessage"></param>
        /// <returns></returns>
        public static PushRequest CreateIOSUnicastNotificationRequest(int pType, int pChannelID, string pDeviceToken, string pMessage)
        {
            PushRequest mes = new PushRequest();

            mes.PlatForm  = 2;
            mes.Type      = pType;
            mes.ChannelID = pChannelID;
            mes.Request   = IOSNotificationBuilder.CreateNotification(pDeviceToken, pMessage).ToJSON();
            return(mes);
        }
Beispiel #2
0
        /// <summary>
        /// 创建单播的消息(消息类型=通知)推送请求
        /// </summary>
        /// <param name="pType">类型:1-直接发送,其它放入数据库轮循</param>
        /// <param name="pChannelID">对应MessageChannel表中的ID</param>
        /// <param name="pBaiduUserID">百度用户ID</param>
        /// <param name="pBaiduChannelID">百度通道ID</param>
        /// <param name="pMessage">百度推送的对象</param>
        /// <returns></returns>
        public static PushRequest CreateAndroidUnicastNotificationRequest(int pType, int pChannelID, string pBaiduUserID
                                                                          , string pBaiduChannelID
                                                                          , BaiduPushNotification pMessage)
        {
            PushRequest mes = new PushRequest();

            mes.PlatForm  = 1;
            mes.Type      = pType;
            mes.ChannelID = pChannelID;
            mes.Request   = PushMsgRequestBuilder.CreateUnicastNotificationRequest(pBaiduUserID, pBaiduChannelID, pMessage).ToJSON();
            return(mes);
        }
Beispiel #3
0
        /// <summary>
        /// 创建单播的消息(消息类型=消息)推送请求
        /// </summary>
        /// <param name="pType">类型:1-直接发送,其它放入数据库轮循</param>
        /// <param name="pChannelID">对应MessageChannel表中的ID</param>
        /// <param name="pBaiduUserID">百度用户ID</param>
        /// <param name="pBaiduChannelID">百度通道ID</param>
        /// <param name="pMessage">消息内容</param>
        /// <returns></returns>
        public static PushRequest CreateAndroidUnicastMessageRequest(int pType, int pChannelID, string pBaiduUserID
                                                                     , string pBaiduChannelID
                                                                     , string pMessage
                                                                     , PushTypes pushType = PushTypes.Unicast)
        {
            PushRequest mes = new PushRequest();

            mes.PlatForm  = 1;
            mes.Type      = pType;
            mes.ChannelID = pChannelID;
            mes.Request   = PushMsgRequestBuilder.CreateUnicastMessageRequest(pBaiduUserID, pBaiduChannelID, null, pMessage, null, pushType).ToJSON();
            return(mes);
        }