微信分享到朋友圈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微信分享介面 點擊按鈕,觸發微信分享到朋友圈
樓主找到解決方法了沒,怎麼樣能模擬點擊?我也只找這問題。