uni.createPushMessage({
title:message.data.nickname,
content:message.data.content,
//icon:'file://'+this.logo,
icon:"file:///storage/emulated/0/Android/data/net.xxx.www/apps/__UNI__D0039AA/www/static/logo.png",
cover:true,
//icon:'_www/static/logo.png'
})
- 发布:2022-10-23 12:35
- 更新:2022-11-06 15:31
- 阅读:456
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 1
HBuilderX类型: 正式
HBuilderX版本号: 3.6.7
手机系统: Android
手机系统版本号: Android 11
手机厂商: 华为
手机机型: mate40和三星s10
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
uni.createPushMessage({
title:message.data.nickname,
content:message.data.content,
//icon:'file://'+this.logo,
icon:"file:///storage/emulated/0/Android/data/net.xxx.www/apps/__UNI__D0039AA/www/static/logo.png",
cover:true,
//icon:'_www/static/logo.png'
})
uni.createPushMessage({
title:message.data.nickname,
content:message.data.content,
//icon:'file://'+this.logo,
icon:"file:///storage/emulated/0/Android/data/net.xxx.www/apps/__UNI__D0039AA/www/static/logo.png",
cover:true,
//icon:'_www/static/logo.png'
})
预期结果:
uni.createPushMessage({
title:message.data.nickname,
content:message.data.content,
//icon:'file://'+this.logo,
icon:"file:///storage/emulated/0/Android/data/net.xxx.www/apps/__UNI__D0039AA/www/static/logo.png",
cover:true,
//icon:'_www/static/logo.png'
})
uni.createPushMessage({
title:message.data.nickname,
content:message.data.content,
//icon:'file://'+this.logo,
icon:"file:///storage/emulated/0/Android/data/net.xxx.www/apps/__UNI__D0039AA/www/static/logo.png",
cover:true,
//icon:'_www/static/logo.png'
})
实际结果:
uni.createPushMessage({
title:message.data.nickname,
content:message.data.content,
//icon:'file://'+this.logo,
icon:"file:///storage/emulated/0/Android/data/net.xxx.www/apps/__UNI__D0039AA/www/static/logo.png",
cover:true,
//icon:'_www/static/logo.png'
})
uni.createPushMessage({
title:message.data.nickname,
content:message.data.content,
//icon:'file://'+this.logo,
icon:"file:///storage/emulated/0/Android/data/net.xxx.www/apps/__UNI__D0039AA/www/static/logo.png",
cover:true,
//icon:'_www/static/logo.png'
})
bug描述:
uni.createPushMessage()本地创建推送消息,logo设置无效,相对路径和绝对路径都试过了,总是显示那个龙形状的小图标
uniapppp (作者)
已回复图片
2022-11-06 15:32
DCloud_Android_THB
回复 uniapppp: 你好,这个图标是个推的默认小图标,
icon
属性是设置大图标的,如果你想设置小图标,需要在hx的推送设置里配置小图标。2022-11-08 11:52