首页 > 编程知识 正文

Node Dcloud集成个推推送平台,极光个推推送比较

时间:2023-05-06 20:59:39 阅读:274807 作者:3517

注册什么的不说了  直接说单个推送和全部推送。

单个推送,需要获取手机应用clientid

获取clientid代码

var cid = plus.push.getClientInfo().clientid;

后台调用代码

var template = new NotificationTemplate({appId: APPID,appKey: APPKEY,title: obj.title,text: obj.text,logoUrl: 'http://wwww.igetui.com/logo.png',        isRing: true,isVibrate: true,isClearable: false,transmissionType: obj.num,transmissionContent: obj.content});var message = new SingleMessage({//指定cid推送isOffline: true, //是否离线offlineExpireTime: 3600 * 12 * 1000, //离线时间data: template, //设置推送消息类型pushNetWorkType:0 //是否wifi ,0不限,1wifi});var target = new Target({appId: APPID,clientId: CID}); gt.pushMessageToSingle(message, target, function(err, res){ console.log(res); if(err != null && err.exception !

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。