|
function fnAliPushInit(){
var supplier_id = fnGetUserId();
acmPush = api.require('acmPush');
acmPush.turnOnPushChannel({
}, function(ret, err) {
if(status){
//添加设备别名
acmPush.addAlias({
alias:'bjgys_'+ supplier_id
});
acmPush.addMessageListener({
listenerName:'name',
}, function(ret, err) {
//点击通知打开App
if(ret.status || ret.true){
fnRefreshChatList();
alert(JSON.stringify(ret))
}
if(api.systemType == 'ios'){
if(ret.type == 1){
api.openWin({
name: 'chat_detail',
url: '../html/chat_detail.html',
pageParam: {
}
});
}
}else{
if(ret.type == 4){
api.openWin({
name: 'chat_detail',
url: '../html/chat_detail.html',
pageParam: {
}
});
}
}
});
}
});
}
代码是这样写的 |
|