使用uni.share时,iOS提醒:由于不支持分享类型,Android可使用,直接分享好友
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 2,
imageUrl: this.shareImg,
success: res=> {
console.log("success:" + JSON.stringify(res));
},
fail: err=> {
console.log("fail:" + JSON.stringify(err));
}
});
可使用:
// pictures 参数为数组 注意图片路径要是本地路径 base64也可以
var msg = {
pictures: [this.shareImg],
type:'image'
};
plus.share.sendWithSystem(msg, function(){
console.log('分享成功');
}, function(e){
console.log('分享失败:'+JSON.stringify(e));
}
);