Android分享视频,提示当前分享的应用未获得分享权限,无法分享到微信?
[图片] APP主体是国内的,以下是代码片段 WXMediaMessage msg;
Uri videoUri = UriUtils.file2Uri(FileUtils.getFileByPath(videoFilePath));
// 创建WXVideoFileObject对象,设置视频文件路径
WXVideoFileObject videoFileObject = new WXVideoFileObject();
videoFileObject.filePath = videoUri.toString();
msg = new WXMediaMessage(videoFileObject);
msg.title = tripName;
msg.description = "完赛视频";
msg.thumbData = compressBitmap(videoBitmap);
if (msg.thumbData.length > 32768) {
ToastUtils.showShort("缩略图大小超过32KB限制");
return;
}
//构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "video" + System.currentTimeMillis();
req.message = msg;
req.scene = SendMessageToWX.Req.WXSceneSession;
//调用api接口,发送数据到微信
if (api.registerApp(appId))
api.sendReq(req);