Exemple #1
0
        /// <summery>推送普通消息给全部的设备,限iOS系统使用
        /// <param name = "appID"> V3版本接口中对应用的标识 </param>
        /// <param name = "accessID"> V2版本接口中系统自动生成的标识 </param>
        /// <param name = "secretKey"> 用于API调用的秘钥 </param>
        /// <param name = "content"> 消息内容 </param>
        /// <param name = "environment"> 指定推送环境 </param>
        /// <returns> 推送结果描述 </returns>
        /// </summery>
        public static string pushAlliOS(string appID, long accessID, string secretKey, string content, PushEnvironmentofiOS environment)
        {
            MessageiOS message = new MessageiOS();

            message.setAlert(content);

            XingeApp xinge = new XingeApp(appID, accessID, secretKey);
            string   ret   = xinge.PushAllDevice(message, environment);

            return(ret);
        }
        //推送给全部的设备,限IOS系统使用
        public static string pushAllIos(long accessId, string secretKey, string content, int env)
        {
            MessageIOS message = new MessageIOS();

            message.setAlert(content);
            message.setBadge(1);
            message.setSound("beep.wav");

            XingeApp xinge = new XingeApp(accessId, secretKey);
            string   ret   = xinge.PushAllDevice(message, env);

            return(ret);
        }
Exemple #3
0
        /// <summery>推送普通消息给全部的设备,限Android系统使用
        /// <param name = "appID"> V3版本接口中对应用的标识 </param>
        /// <param name = "accessID"> V2版本接口中系统自动生成的标识 </param>
        /// <param name = "secretKey"> 用于API调用的秘钥 </param>
        /// <param name = "title"> 消息标题 </param>
        /// <param name = "content"> 消息内容 </param>
        /// <returns> 推送结果描述 </returns>
        /// </summery>
        public static string pushAllAndroid(string appID, long accessID, string secretKey, string title, string content)
        {
            Message message = new Message();

            message.setType(XGPushConstants.OrdinaryMessage);
            message.setTitle(title);
            message.setContent(content);

            XingeApp xinge = new XingeApp(appID, accessID, secretKey);
            string   ret   = xinge.PushAllDevice(message);

            return(ret);
        }
        //推送给全部的设备,限Android系统使用
        public static string pushAllAndroid(long accessId, string secretKey, string title, string content)
        {
            Message message = new Message();

            message.setType(Message.TYPE_NOTIFICATION);
            message.setTitle(title);
            message.setContent(content);

            XingeApp xinge = new XingeApp(accessId, secretKey);
            string   ret   = xinge.PushAllDevice(message);

            return(ret);
        }