标题设置的是XX年华,并没有null,但是分享到朋友圈就会莫名加个null,而且对msg.title和msg.description无论设置什么值,都无法改变分享到朋友圈的标题,分享到个人是没问题的。猜测朋友圈是读的网页的head,目前设置了<title>XX年华</title>,没有设置描述。请问改怎么改?可以让移动端控制朋友圈的标题或者web端应该怎么改代码呢?感谢
代码如下
val webPageObj = WXWebpageObject()
webPageObj.webpageUrl = shareBuilder.shareUrl()
val msg = WXMediaMessage()
msg.setThumbImage(thumb)
msg.mediaObject = webPageObj
msg.description = "描述"
val req = SendMessageToWX.Req()
req.message = msg
req.transaction = System.currentTimeMillis().toString()
if (shareBuilder.sharePlatform == SharePlatform.WechatMoments) {
req.scene = SendMessageToWX.Req.WXSceneTimeline
msg.title = "标题"
} else {
req.scene = SendMessageToWX.Req.WXSceneSession
msg.title = "标题"
}
api.sendReq(req);