霸王
霸王
  • 发布:2018-08-25 22:01
  • 更新:2018-09-07 23:50
  • 阅读:2208

【报Bug】IOS云端打包后分享只显示标题,没有图片和描述

分类:HBuilder

详细问题描述
[内容]
<script type="text/javascript" charset="utf-8">
mui.init();
var sharetitle='uuu',
sharecontent='请您离名校更近一步!',
sharehref=apiurl+"/sharepage/app.html"
var shares=null;
function plusReady1(){
updateSerivces();
}
document.addEventListener("plusready",plusReady1,false);
function updateSerivces(){
console.log("a")
plus.share.getServices( function(s){
shares={};
for(var i in s){
var t=s[i];
shares[t.id]=t;
console.log(JSON.stringify(t))
}
}, function(e){
mui.toast( "获取分享服务列表失败:"+e.message );
} );

}
function shareAction(sb,bh) {
//mui.toast( "分享操作:" );
if(!sb||!sb.s){
//mui.toast( "无效的分享服务!" );
return;
}
var msg={content:"",extra:{scene:sb.x}};
if(bh){
msg.href=sharehref;
msg.title=sharetitle;
msg.content=sharecontent;
msg.thumbs=[apiurl+"/img/sharelogo.png"];
msg.pictures=[apiurl+"/img/sharelogo.png"];
}else{
if(pic&&pic.realUrl){
msg.pictures=[pic.realUrl];
}
}
// 发送分享
if ( sb.s.authenticated ) {
//mui.toast( "---已授权---" );
shareMessage(msg,sb.s);
} else {
//mui.toast( "---未授权---" );
sb.s.authorize( function(){
shareMessage(msg,sb.s);
},function(e){
//mui.toast( "认证授权失败:"+e.code+" - "+e.message );
});
}
}
function shareMessage(msg,s){
s.send( msg, function(){
console.log("ok")
try
{
if(typeof(eval("doshareok"))=="function")
{
console.log("has")
}
}catch(e)
{
console.log("none")
return false;
}
}, function(e){
mui.toast( "分享到\""+s.description+"\"失败: "+JSON.stringify(e) );
} );
}
document.getElementById("weixinshare").addEventListener('tap',function(){
var shareBts=[];
shareBts.push({title:'微信好友',s:shares['weixin'],x:'WXSceneSession'})
shareAction(shareBts[0],true)
})
document.getElementById("weixinpyqshare").addEventListener('tap',function(){
var shareBts=[];
shareBts.push({title:'微信朋友圈',s:shares['weixin'],x:'WXSceneTimeline'})
shareAction(shareBts[0],true)
})
</script>

重现步骤
[步骤]微信开放平台的appid和AppSecret都有,包名也对应
[结果]标准基座真机调试没问题,自定义基座调试和云打包后,分享给微信好友或朋友圈都是只显示标题,不显示图片和描述,图片8KB
[期望]期望尽快可以完善,公司多个项目都会用到

运行环境
[系统版本]IOS 11.4
[浏览器版本]
[IDE版本]HBuilder 9.1.13.201807311957-alpha
[mui版本]

附件
[代码片段]

2018-08-25 22:01 负责人:无 分享
已邀请:
霸王

霸王 (作者)

已解决
新版增加了分享消息的类型
加上msg.type="web";
参考:http://www.dcloud.io/docs/api/zh_cn/share.html#plus.share.ShareMessage

biubiu灬

biubiu灬

我也遇到一样的问题,不知道为什么,上星期打包的一版还可以。这星期打包的这一版不行了。

guojiahsuai

guojiahsuai

遇到同样的问题;调模式 微信分享图片可以正常分享,打包可以跳转微信分享,但是图片不能分享出去,content 内容可以分享出去;iOS 安卓问题相同; 希望尽快解决

该问题目前已经被锁定, 无法添加新回复