Ejemplo n.º 1
0
 public static TransmissionTemplate TransmissionTemplateDemo()
 {
     TransmissionTemplate template = new TransmissionTemplate();
     template.AppId = APPID;
     template.AppKey = APPKEY;
     //应用启动类型,1:强制应用启动 2:等待应用启动
     template.TransmissionType = "2";
     //透传内容	
     template.TransmissionContent = "您有一条新消息";
     template.setPushInfo("actionLocKey", 4, "message", "sound",
     "payload", "locKey", "locArgs", "launchImage");
     /*IOS 推送需要对该字段进行设置具体参数详见2.5*/
     return template;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 透传模板动作内容
        /// </summary>
        /// <param name="transContent">透传内容</param>
        /// <param name="beginTM">客户端展示开始时间</param>
        /// <param name="endTM">客户端展示结束时间</param>
        /// <returns></returns>
        public TransmissionTemplate TransmissionTemplate(string transContent, string beginTM, string endTM)
        {
            TransmissionTemplate template = new TransmissionTemplate();

            template.AppId               = APPID;
            template.AppKey              = APPKEY;
            template.TransmissionType    = "1";          //应用启动类型,1:强制应用启动 2:等待应用启动
            template.TransmissionContent = transContent; //透传内容
            //iOS推送需要的pushInfo字段
            //template.setPushInfo(actionLocKey, badge, message, sound, payload, locKey, locArgs, launchImage);
            template.setPushInfo("1", 4, "2", "", "", "", "", "");
            //设置客户端展示时间
            String begin = beginTM;
            String end   = endTM;

            template.setDuration(begin, end);
            return(template);
        }
Ejemplo n.º 3
0
        /*
         *
         * 所有推送接口均支持四个消息模板,依次为透传模板,通知透传模板,通知链接模板,通知弹框下载模板
         * 注:IOS离线推送需通过APN进行转发,需填写pushInfo字段,目前仅不支持通知弹框下载功能
         *
         */
        //透传模板动作内容--模版1
        public static TransmissionTemplate TransmissionTemplateDemo(int PaltForm, string title, string content, string custom_content)
        {
            TransmissionTemplate template = new TransmissionTemplate();

            template.AppId               = APPID;
            template.AppKey              = APPKEY;
            template.TransmissionType    = "1";      //应用启动类型,1:强制应用启动 2:等待应用启动
            template.TransmissionContent = content;  //透传内容

            //iOS推送需要的pushInfo字段
            if (PaltForm == 1)
            {
                //iOS推送需要的pushInfo字段
                template.setPushInfo("actionLocKey", 4, "message", "sound", "payload", "locKey", "locArgs", "launchImage");
            }
            //template.setPushInfo(actionLocKey, badge, message, sound, payload, locKey, locArgs, launchImage);
            //template.setPushInfo("", 4, "", "", "", "", "", "");
            return(template);
        }