eeui plugin install https://github.com/Fang-NB-Plus/wxc-jpush
eeui plugin uninstall https://github.com/Fang-NB-Plus/wxc-jpush
eeui.config.js 配置如下:
module.exports = {
//......
"jpush": {
"JPUSH_APPID":"0ba7dd2002a3aa84c21c8371",
"JPUSH_APPKEY":"",
"JPUSH_APPSECRET":"",
"XIAOMI_APPID": "",
"XIAOMI_APPKEY": "",
"MEIZU_APPID": "",
"MEIZU_APPKEY": "",
"HUAWEI_APPID": "",
"OPPO_APPKEY": "",
"OPPO_APPSECRET": "",
"VIVO_APPID": "",
"VIVO_APPKEY": ""
},
//......
}
const jpush = app.requireModule("eeuiJpush");
如图所示添加iOS推送模块 更多设置请参照极光官网设置
jpush.setTags(resulte=>{
if(resulte === ture){
//设置成功
}
})
jpush.deleteTags(resulte=>{
if(resulte === ture){
//设置成功
}
})
jpush.getAllTags(resulte=>{
//resulte是一个数组对象
})
jpush.clearTags(resulte=>{
if(resulte === ture){
//清除成功
}
})
jpush.setAlias(resulte=>{
if(resulte === ture){
//设置成功
}
})
jpush.getAlias(resulte=>{
//resulte是一个字符串
})
jpush.deleteAlias(resulte=>{
if(resulte === ture){
//清除成功
}
})
pageMessage(data) {
let msg = data.message;
if (msg.type === "notification"){
//获取消息实体
let notification = msg.data;
console.log(notification);
}
},