WXWebpageObject webpage = new WXWebpageObject();
webpage.webpageUrl = webUrl;
WXMediaMessage msg = new WXMediaMessage(webpage);
if (type ==1) {
msg.title = title;
}else {
msg.title = msg;
}
msg.description = msg;
Bitmap thumb = BitmapFactory.decodeResource(BaseApplication.getInstance().getResources(), R.mipmap.ic_launcher);
msg.thumbData = BitmapUtils.bmpToByteArray(thumb, true);
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = buildTransaction("webpage");
req.message = msg;
req.scene = type==0 ? SendMessageToWX.Req.WXSceneTimeline : SendMessageToWX.Req.WXSceneSession;
App.mWxApi.sendReq(req);
分享好友正常吗