const webpageObject = new wxopensdk.WXWebpageObject()
webpageObject.webpageUrl = "http://www.qq.com"
const mediaMessage = new wxopensdk.WXMediaMessage()
mediaMessage.mediaObject = webpageObject
mediaMessage.title = "测试网页链接"
mediaMessage.description = "测试网页摘要"
const thumbData = await getContext(this).resourceManager.getMediaContent($r("app.media.thumb_img"))
const thumbPixel = image.createImageSource(thumbData.buffer).createPixelMapSync()
const thumbBuffer = await image.createImagePacker().packToData(thumbPixel, { format: "image/png", quality: 100 })
mediaMessage.thumbData = new Uint8Array(thumbBuffer)
const req = new wxopensdk.SendMessageToWXReq()
req.callbackAbility = kDemoEntryAbility
req.scene = wxopensdk.SendMessageToWXReq.WXSceneSession
req.message = mediaMessage
this.wxApi.sendReq(getContext(this) as common.UIAbilityContext, req)
你好,机型,微信版本号和复现链接,普通微信分享正常是吗?
我也遇到了,可能跟微信版本有关?