赞
踩
- var pinf = plus.push.getClientInfo();
- var cid = pinf.clientid;//客户端标识
- console.log('cid=='+cid)
-
- plus.push.addEventListener("receive", function(msg) {
- if ( msg.aps ) { // Apple APNS message
- //APNS下发的消息,应用在前台
- plus.push.createMessage(msg.content, msg.payload, {title: msg.title});
- } else if ( msg.type != "receive" ) { // 特殊payload标识本地创建的消息
- //本地创建的消息,通常不需要处理
- //注意:不要在这种情况下再此调用plus.push.createMessage,从而引起循环创建本地消息
- } else {
- //接收到在线透传消息
- plus.push.createMessage(msg.content, msg.payload, {title: msg.title});
- }
- }, false );
-
- plus.push.addEventListener("click", function(msg) {
- //todo
- }, false );
-
- };

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。