Beispiel #1
0
        public void XGTestSingleDevice()
        {
            QQXGProvider            qqxg = new QQXGProvider();
            XGPushSingleDeviceParam xgp  = new XGPushSingleDeviceParam();

            xgp.Timestamp  = null;
            xgp.Valid_time = 600; //600;
            xgp.Sign       = null;
            //============测试DEMO==============
            xgp.Access_id = 2100025233;
            //xgp.Access_Key = "ARQ4CB14Q92X";
            xgp.Secret_Key = "6ae193c85570ad1cc8fc9540560093b1";
            //============测试DEMO==============
            //xgp.Access_id = 2100025346;
            //xgp.Access_Key = "AUP1I5W741WJ";
            //xgp.Secret_Key = "f2391810bc98c0d7435ec7c96b8f524f";
            xgp.Message_type = 1;
            xgp.Message      = new NotifyMessage()
            {
                Title   = "XGTestSingleDevice",
                Content = "XGTestSingleDevice",
                Vibrate = 1
            };
            xgp.Device_token = "ef8d1c5b866652d14e62bbee2aac3b28b7ed2bf9";
            //POSTopenapi.xg.qq.com/v2/push/all_deviceaccess_id=2100025233timestamp=1399859926valid_time=6006ae193c85570ad1cc8fc9540560093b1
            XGResult <string> a = qqxg.PushSingleDevice(xgp);
        }
Beispiel #2
0
        public void XGTestGetMsgStatus()
        {
            QQXGProvider            qqxg = new QQXGProvider();
            XGPushGetMsgStatusParam xgp  = new XGPushGetMsgStatusParam();

            xgp.Timestamp  = null;
            xgp.Valid_time = 600; //600;
            xgp.Sign       = null;
            //============测试DEMO==============
            //xgp.Access_id = 2100025233;
            //xgp.Access_Key = "ARQ4CB14Q92X";
            //xgp.Secret_Key = "6ae193c85570ad1cc8fc9540560093b1";
            //============测试DEMO==============
            xgp.Access_id = 2100025346;
            //xgp.Access_Key = "AUP1I5W741WJ";
            xgp.Secret_Key = "f2391810bc98c0d7435ec7c96b8f524f";
            xgp.Push_ids   = new System.Collections.Generic.List <Push_Id_Obj>();
            xgp.Push_ids.Add(new Push_Id_Obj()
            {
                Push_id = "152947"
            });
            xgp.Push_ids.Add(new Push_Id_Obj()
            {
                Push_id = "152944"
            });
            xgp.Push_ids.Add(new Push_Id_Obj()
            {
                Push_id = "139303"
            });
            XGResult <XGGetMsgStatusResult> a = qqxg.PushGetMsgStatus(xgp);
        }
Beispiel #3
0
        public void XGTestTagsDevice()
        {
            QQXGProvider          qqxg = new QQXGProvider();
            XGPushTagsDeviceParam xgp  = new XGPushTagsDeviceParam();

            xgp.Timestamp  = null;
            xgp.Valid_time = 600; //600;
            xgp.Sign       = null;
            //============测试DEMO==============
            //xgp.Access_id = 2100025233;
            //xgp.Access_Key = "ARQ4CB14Q92X";
            //xgp.Secret_Key = "6ae193c85570ad1cc8fc9540560093b1";
            //============测试DEMO==============
            xgp.Access_id = 2100025346;
            //xgp.Access_Key = "AUP1I5W741WJ";
            xgp.Secret_Key   = "f2391810bc98c0d7435ec7c96b8f524f";
            xgp.Message_type = 1;
            xgp.Message      = new NotifyMessage()
            {
                Title   = "XGTestTagsDevice",
                Content = "XGTestTagsDevice",
                Vibrate = 1,
                Ring    = 1
            };
            xgp.Tags_list = new System.Collections.Generic.List <string>();
            xgp.Tags_list.Add("nature");
            xgp.Tags_op = "OR";
            //POSTopenapi.xg.qq.com/v2/push/all_deviceaccess_id=2100025233timestamp=1399859926valid_time=6006ae193c85570ad1cc8fc9540560093b1
            XGResult <XGPushResult> a = qqxg.PushTagsDevice(xgp);
            string a1 = a.Err_msg;
        }
Beispiel #4
0
        public void XGTestAllDevice()
        {
            QQXGProvider         qqxg = new QQXGProvider();
            XGPushAllDeviceParam xgp  = new XGPushAllDeviceParam();

            xgp.Timestamp  = null; //1299865775;
            xgp.Valid_time = 600;  //600;
            xgp.Sign       = null;
            //实际key请使用实际的,下面仅演示作用
            //============测试key1==============
            xgp.Access_id = 2100025233;
            //xgp.Access_Key = "ARQ4CB14Q92X";
            xgp.Secret_Key = "6ae193c85570ad1cc8fc9540560093b1";
            //============测试key2==============
            //xgp.Access_id = 2100025346;
            //xgp.Access_Key = "AUP1I5W741WJ";
            //xgp.Secret_Key = "f2391810bc98c0d7435ec7c96b8f524f";
            xgp.Message_type = 1;
            xgp.Expire_time  = 3600;
            xgp.Message      = new NotifyMessage()
            {
                Custom_content = new  SerializableDictionary <string, string>()
                {
                    { "type", "123" }, { "type1", "456" }
                },
                //Accept_time = new System.Collections.Generic.List<AcceptTime>(){
                //  new AcceptTime(){ Start=new XGTime(){ Hour="18", Min="02"}, End=new XGTime(){ Hour="18", Min="30"}}
                //},
                Clearable = 1,
                Title     = "XGTestAllDevice-50%",
                Content   = "有中文10%,人们有1%以及,$abcdef", //中文测试
                Vibrate   = 1,
                Ring      = 1,
                Action    = new NotifyMessageAction()
                {
                    Action_type = 2,
                    Browser     = new NotifyMessageAction_Browser()
                    {
                        Url     = "http://baidu.com",
                        Confirm = 0
                    },
                    Intent   = "http://baidu.com",
                    Activity = "XGPushDemo"
                }
            };
            //xgp.Send_time = DateTime.Now.AddMinutes(2).ToString("yyyy-MM-dd HH:mm:ss");

            //POSTopenapi.xg.qq.com/v2/push/all_deviceaccess_id=2100025233timestamp=1399859926valid_time=6006ae193c85570ad1cc8fc9540560093b1
            //string xml = SerializeToXML<XGPushAllDeviceParam>(xgp);
            //XGPushAllDeviceParam t = DeSerializeXML<XGPushAllDeviceParam>(xml);
            XGResult <XGPushResult> a = qqxg.PushAllDevices(xgp);
            //Console.WriteLine(xml);
            //Console.WriteLine(t.ToString());
        }
Beispiel #5
0
        public void XGTestGetAppDeviceNum()
        {
            QQXGProvider qqxg = new QQXGProvider("application");
            XGPushGetAppDeviceNumParam xgp = new XGPushGetAppDeviceNumParam();

            xgp.Timestamp  = null;
            xgp.Valid_time = 600; //600;
            xgp.Sign       = null;
            //============测试DEMO==============
            //xgp.Access_id = 2100025233;
            //xgp.Access_Key = "ARQ4CB14Q92X";
            //xgp.Secret_Key = "6ae193c85570ad1cc8fc9540560093b1";
            //============测试DEMO==============
            xgp.Access_id = 2100025346;
            //xgp.Access_Key = "AUP1I5W741WJ";
            xgp.Secret_Key = "f2391810bc98c0d7435ec7c96b8f524f";
            XGResult <XGDeviceNumResult> a = qqxg.GetAppDeviceNum(xgp);
        }
Beispiel #6
0
        public void XGTestCancelTimingTask()
        {
            QQXGProvider       qqxg = new QQXGProvider();
            XGOtherCommonParam xgp  = new XGOtherCommonParam();

            xgp.Timestamp  = null;
            xgp.Valid_time = 600; //600;
            xgp.Sign       = null;
            //============测试DEMO==============
            //xgp.Access_id = 2100025233;
            //xgp.Access_Key = "ARQ4CB14Q92X";
            //xgp.Secret_Key = "6ae193c85570ad1cc8fc9540560093b1";
            //============测试DEMO==============
            xgp.Access_id = 2100025346;
            //xgp.Access_Key = "AUP1I5W741WJ";
            xgp.Secret_Key = "f2391810bc98c0d7435ec7c96b8f524f";
            xgp.Push_id    = "139303";
            XGResult <XGStatusResult> a = qqxg.PushCancelTimingTask(xgp);
        }