uniapp接阿里云移动推送,通知栏没有弹出通知弹窗,也无法做到离线推送

“`if (platform == ‘android’) {
// 注册推送,开始接收数据
aliyunPush.registerPush({}, result => {
const event = result.event;
const channel = uni.requireNativePlugin(‘Aliyun-Push-NotificationChannel’);
// 检查 应用通知通道的总开关
const channelRes = channel.isNotificationEnabled({
id: ‘amp_channel’
});
// 先创建NotificationChannel
channel.createChannel({
id: ‘amp_channel’,
name: ‘安卓通知通道’,
desc: ‘安卓通知通道’,
importance: 3,
});
// 厂商通道
const aliyunThirdPush = uni.requireNativePlugin(‘Aliyun-ThirdPush’);
aliyunThirdPush.registerThirdPush({}, thirdRes => {
const data = JSON.stringify(thirdRes);
androidOperations(data, 1)
})
// 注册日志接口
aliyunThirdPush.registerLog({}, result => {
console.log(“third push plugin log : ” + result);
})
// 注册推送
if (event === ‘registerPush’) {
if (result.code === ‘success’) {
console.log(“注册推送 成功 “);
// 获取设备推送ID,注意必须注册推送成功之后,才能获取
const idResult = aliyunPush.getDeviceId();
if (idResult.data.deviceId != ”) {
// 存设备ID
console.log(idResult.data.deviceId, ‘存设备ID’);
uni.setStorageSync(‘registerID’, idResult.data.deviceId);
}
} else {
console.log(“注册推送 ” + result.code + ” ” + result.msg);
}
}
// 打开通知
else if (event === ‘onNotificationOpened’) {
// 跳转,具体业务
const res = JSON.stringify(result);
androidOperations(res, 2)
} else {
console.log(“receive push data : ” + JSON.stringify(result));
// uniapp的消息通知栏提示框
uni.createPushMessage({
title: result.data.title,
content: result.data.content
})
}
});
}



这里是安卓端代码,在emas后台推送信息,前台是能收到推送信息的,但是无法自己创建通知栏通知,只能自己通过uni.createPushMessage来创建,然后推送信息,只能拿到
```{"event":"onNotification","data":{"content":"测试通知内容2","title":"测试通知标题2","extra":{"_ALIYUN_NOTIFICATION_MSG_ID_":"8582154545503232","_ALIYUN_NOTIFICATION_ID_":"595725"}}}

拿不到跳具体页面的路径。求教怎么处理

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
=====这是一个广告位,招租中,联系qq 78315851====