微信分享到朋友圈jssdk是
❶ 微信里的链接,提示要分享到朋友圈或者转发才能看到内容是怎么设置的
1、首先打开手机上的微信,进入页面。
❷ 微信SDK要如何分享到朋友圈
[mw_shl_code=java,true]private void shareToFriend(File file) {
Intent intent = new Intent();
ComponentName comp = new ComponentName("com.tencent.mm",
"com.tencent.mm.ui.tools.ShareImgUI");
intent.setComponent(comp);
intent.setAction("android.intent.action.SEND");
intent.setType("image/*"); intent.putExtra(Intent.EXTRA_TEXT,"我是文字");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
startActivity(intent);
}
private void shareToTimeLine(File file) {
Intent intent = new Intent();
ComponentName comp = new ComponentName("com.tencent.mm",
"com.tencent.mm.ui.tools.ShareToTimeLineUI");
intent.setComponent(comp);
intent.setAction("android.intent.action.SEND");
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_TEXT,"我是文字");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
startActivity(intent);
}[/mw_shl_code]
❸ 求教,关于微信分享的JSSDK错误
我看根据网上教程调了一整天了。还是调不出分享图片和标题。不知道那个地方出错了。显示的进展是ready执行了。
❹ 最新的微信JSSDK分享接口是不是有问题呀还是我的代码哪里错了
wx.onMenuShareTimeline({
title: '互联网之子',
link: 'http://wx.vland.cc/mobile.php?act=mole&rid=406&fromuser=oktsYuHivHXuzdsMeCbWyF7b14UU&name=hllihe&do=sharelihe&weid=7',
imgUrl: 'http://wx.vland.cc/resource/attachment/images/7/2015/01/.jpg',
trigger: function (res) {
alert('用户点击分享到朋友圈');
},
success: function (res) {
alert('已分享');
},
cancel: function (res) {
alert('已取消');
},
fail: function (res) {
alert('wx.onMenuShareTimeline:fail: '+JSON.stringify(res));
}
});
你可以绑定到一个按钮点击事件上面,或者和上面说的一样 延迟加载
把
wx.onMenuShareTimeline({
title: '互联网之子',
link: 'http://wx.vland.cc/mobile.php?act=mole&rid=406&fromuser=oktsYuHivHXuzdsMeCbWyF7b14UU&name=hllihe&do=sharelihe&weid=7',
imgUrl: 'http://wx.vland.cc/resource/attachment/images/7/2015/01/.jpg',
trigger: function (res) {
alert('用户点击分享到朋友圈');
},
success: function (res) {
alert('已分享');
},
cancel: function (res) {
alert('已取消');
},
fail: function (res) {
alert('wx.onMenuShareTimeline:fail: '+JSON.stringify(res));
}
});
把这段代码,封装成个函数,然后用settimeout延迟2秒加载试试。
❺ 请教如何触发 js微信分享接口 点击按钮,触发微信分享到朋友圈。
前提是你的公众号已打开onMenuShareTimeline权限
wx.config({
debug: true,
appId: "你的APPID",
timestamp: "xxx",
nonceStr: "xxx",
signature: "xxx",
jsApiList: [ 'onMenuShareTimeline', ] //onMenuShareTimeline你要的方法
});
❻ 怎么使用微信jssdk的自定义分享功能
<script>
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '${appId}', // 必填,公众号的唯一标识
timestamp: ${timestamp}, // 必填,生成签名的时间戳
nonceStr: '${noncestr}', // 必填,生成签名的随机串
signature: '${signature}',// 必填,签名,见附录1
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage',
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function(){
//分享到朋友圈
wx.onMenuShareTimeline({
title: '号外!号外!', // 分享标题
desc: '号外!号外!特大号外', // 分享描述
link: 'url', // 分享链接
imgUrl: 'logo/logo-2.png', // 分享图标
success: function () {
}
});
//分享给好友
wx.onMenuShareAppMessage({
title: '号外!号外!', // 分享标题
desc: '号外!号外!特大号外', // 分享描述
link: 'url', // 分享链接
imgUrl: 'logo/logo-2.png', // 分享图标
success: function () {
}
});
});
</script>
❼ 【求帮助】 微信JSSDK 分享接口,调用没反应
你在wx.config时,打开调试模式,自己测试测试,在调试模式下,都会alert信息出来,看看alert出来的是什么信息。
❽ 请教如何触发 js微信分享接口 点击按钮,触发微信分享到朋友圈
楼主找到解决方法了没,怎么样能模拟点击?我也只找这问题。