zoukankan      html  css  js  c++  java
  • 百度云推送

    展开

     

    调用方法

    /// <summary>
            /// 推送通知给所有人
            /// </summary>
            public static JsonResponse PushAllNotification(DeviceType deviceType, PushMessage msg)
            {
                var req = new PushMsgRequest();
    
                req.DeviceType = (uint)deviceType;
                req.PushType = 3;
    
                req.MessageType = 1;
                req.MsgKeys = msg.Key;
                req.Messages = GetNotification(deviceType, msg);
                if (deviceType == DeviceType.iOS) req.DeployStatus = DEPLOY_STATUS; //IOS需指定部署状态
                var res = PushClient.Execute(req);
    
    
                JsonResponse jsonResponse = new JsonResponse();
                if (res.IsError == false)
                {
                    jsonResponse.status = 0;
                    jsonResponse.message = "成功";
                    jsonResponse.data = res.Body;
                }
                else
                {
                    jsonResponse.status = 1;
                    jsonResponse.message = "失败";
                    jsonResponse.data = res.Body;
                }
    
                return jsonResponse;
                //return res.IsError ? 0 : res.ResponseParams.SuccessAmount;
            }

     

    参考:https://baidupush.codeplex.com/

  • 相关阅读:
    error C4430: missing type specifier int assumed. Note: C++ does not support defaultint 解决方法
    A performance evaluation of local descriptors——局部描述子评估译文(1,2,...)
    global mapper裁剪DEM文件的方法
    直方图学习笔记
    vc++如何将客户区存为bmp【zz】
    处理tiff格式dem数据的方法——输出xyz坐标
    处理tiff格式dem数据的方法——输出txt形式高程信息
    我的社区成立了
    Closed socket connection for client /39.103.162.230:56100 (no session established for client)
    Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
  • 原文地址:https://www.cnblogs.com/tangge/p/4191662.html
Copyright © 2011-2022 走看看