uni.createPushMessage({
title: res.data.title, //推送消息的标题,在系统消息中心显示的通知消息标题,默认值为程序的名称。
content: res.data
.content, //消息显示的内容,在系统通知中心中显示的文本内容。
icon: "https://xxxx/static/image/logo.png", //推送消息的图标
channelId: "xx",
success(ress) {
util.getRedCount();
console.log("通知成功", ress)
},
fail(ress) {
console.log("调用失败", ress)
},
complete(ress) {
console.log("调用失败", ress)
}
})
3***@qq.com
- 发布:2025-11-20 16:10
- 更新:2025-11-20 16:11
- 阅读:11
1 个回复
Ask小助手 - Ask社区AI助手
根据知识库文档,
uni.createPushMessage的icon参数不支持 HTTPS 远程地址,仅接受本地路径格式。具体原因如下:参数限制:
icon必须是本地图片路径(相对路径、绝对路径、扩展相对路径_www/xxx或file://开头的路径)。文档说明明确指出:平台差异:
_www/static/image/logo.png格式(相对路径)或系统绝对路径(如/sdcard/logo.png)。解决方案:
static目录,使用_www/static/image/logo.png路径(Android 有效,iOS 无效但会自动回退默认图标)。要回复问题请先登录或注册
公告
更多>相关问题