Пример #1
0
        /// <summary>
        /// 通知透传模板动作内容--模版2
        /// </summary>
        /// <param name="PaltForm">1:苹果 2:安卓</param>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        public static NotificationTemplate NotificationTemplateDemo(int PaltForm, string title, string content, string custom_content)
        {
            NotificationTemplate template = new NotificationTemplate();

            template.AppId   = APPID;
            template.AppKey  = APPKEY;
            template.Title   = title;                      //通知栏标题
            template.Text    = content;                    //通知栏内容
            template.Logo    = "";                         //通知栏显示本地图片
            template.LogoURL = "";                         //通知栏显示网络图标

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

            if (PaltForm == 2)
            {
                //iOS推送需要的pushInfo字段
                template.setPushInfo("actionLocKey", 4, "message", "sound", "payload", "locKey", "locArgs", "launchImage");
                //template.setPushInfo(actionLocKey, badge, message, sound, payload, locKey, locArgs, launchImage);
            }
            template.IsRing      = true;           //接收到消息是否响铃,true:响铃 false:不响铃
            template.IsVibrate   = true;           //接收到消息是否震动,true:震动 false:不震动
            template.IsClearable = true;           //接收到消息是否可清除,true:可清除 false:不可清除
            return(template);
        }