uniapp开发APP 现遇到问题:
安卓、IOS机型 分享功能,分享小程序图片需小于20KB才能分享,超出报错。
鸿蒙机型 分享功能,分享小程序图片需小于13KB才能分享成功,超出报错。
但我看文档是推荐使用 20 KB 的图片,并不是最大20KB啊?这个正常吗?
// 封装APP分享
export function appShare(shareInfo) {
uni.share({
provider: shareInfo.provider||"weixin",
scene: shareInfo.scene||"WXSceneSession",
type: shareInfo.type||5,
title: shareInfo.title||'农千问',
summary: shareInfo.summary||'农千问',
imageUrl: shareInfo.imageUrl||'static/logo.png',
miniProgram: {
id: 'gh_xxxxxxxxxxxx',
path: shareInfo.miniProgram.path||`/pages/index/index`,
type: globalSetting.env == 'production' ? 0 : 2,
webUrl: '#'
},
success: function (res) {
console.log("success:" + JSON.stringify(res));
},
fail: function (err) {
console.log("fail:" + JSON.stringify(err));
}
});
}