8***@qq.com
8***@qq.com
  • 发布:2024-08-14 16:46
  • 更新:2025-12-12 17:08
  • 阅读:635

onShareTimeline 图片不显示,安卓没问题,ios不行

分类:uni小程序sdk

使用onShareTimeline分享到朋友圈,安卓手机都可以
苹果手机标题没问题,但是图片不显示,显示的是默认的链接图标

代码:
onShareTimeline(){
return {
title: 'xxxxx',
query: '',
mageUrl:'https://xxxx.xxxx.com/attachment/images/baselogo.png?t='+Math.random()
}
},

2024-08-14 16:46 负责人:无 分享
已邀请:
doloresme

doloresme

你的问题有解决吗?是什么原因导致的

牛奶包子

牛奶包子

根据知识库内容和经验,iOS 平台微信分享朋友圈时需要注意以下几点:

你的代码中有一个拼写错误 mageUrl 应为 imageUrl(注意大小写,不进行转换)

iOS 平台微信分享必须同时满足:

  • 图片地址需要使用本地路径(网络图片需要先下载到本地)
    • 必须提供 href 参数(即使为空字符串)
  • 修改建议:
  • onShareTimeline(){
  • return {
  • title: 'xxxxx',
  • query: '',
  • imageUrl: '/static/logo.png', // 建议使用本地图片
  • href: '' // iOS必需参数
  • }
  • }
  • 参考文档:onShareAppMessage
  • 内容为 AI 生成,仅供参考
jgj_app

jgj_app

你图片大小超过 20kb了么

要回复问题请先登录注册