//透传消息的格式为{title:"通知标题",content:"通知内容",payload:"通知去干嘛这里可以自定义"}
demo push = new demo();//个推官网下载,稍微改改就行了 strRtn = push.pushMessageToApp(tbxSubject.Text, UEditor1.Text,model.ID);//此处直接赋值就行 //下边是对回调结果的处理 gTuiRtn m = JsonHelper.ParseFormJson<gTuiRtn>(strRtn);//JsonHelper类百度搜 if (m.result == "ok") { Response.Redirect("ArticleList.aspx?code=" + strCode); } else { Response.Write(strRtn); }
public class gTuiRtn { public string result { get; set; } public string contentId { get; set; } }
//安卓客户端
// 监听点击消息事件,app在运行 plus.push.addEventListener("click", function( msg ) { mui.openWindow({ url: 'article_info.html', id: 'article_info', extras: { artid: msg.payload//带参数跳转 } }); }, false ); // 监听消息事件,app不在运行 plus.push.addEventListener("receive", function(msg) { mui.openWindow({ url: 'article_info.html', id: 'article_info', extras: { artid: msg.payload } }); }, false );