繁体   English   中英

Facebook分享按钮和图片

[英]Facebook share button and images

我正在努力插入与FB共享的链接。 链接正在调用JS。 JS打开一个弹出窗口,我的图像丢失了。

我有2个选择:1. sharer.php 2. API?


1:这不显示我的照片!!!

function fbs_click(id, photo) {
    var adv_url = encodeURIComponent("https://www.bikesquare.com.au/product/detail?advertiseId=" + "e77180f8439fe2810143be28c40e000e");
    var photo_url = encodeURIComponent("https://www.bikesquare.com.au/resources/IMG_0554.JPG"); //THIS IS A REAL IMAGE - ONLY FOR TEST!!!

    var new_url="https://www.facebook.com/sharer.php?s=100";
    new_url += "&p[url]="  + adv_url;
    new_url +="&p[images][0]=" + photo_url;
    new_url +="&p[summary]=TEST";
    new_url +="&p[title]=TITLE";

    window.open(new_url, 'Share on FaceBook', 'left=20,top=20,width=550,height=400,toolbar=0,menubar=0,scrollbars=0,location=0,resizable=1');
    return false; //FOR TEST ONLY
}

2:这是显示我的照片,但只有我可以分享! 其他FB帐户无法

var url = 'https://www.facebook.com/dialog/feed?app_id=[MY SECRET API ID]&link=' +
    encodeURIComponent('https://www.bikesquare.com.au/product/detail? advertiseId=') + id +
    '&picture=' + encodeURIComponent(photo_url) +
    '&name=' + encodeURIComponent('BikeSquare Advertise') +
    '&redirect_uri=' + encodeURIComponent('https://www.bikesquare.com.au/');

window.open(url, 'Share on FaceBook', 'left=20,top=20,width=550,height=400,toolbar=0,menubar=0,scrollbars=0,location=0,resizable=1');

如您所见,女士们先生们,我有2种选择。 选项1不显示照片。 选项2需要FB DEV的APP ID,但只有我可以共享它(照片看起来不错)。 其他帐户不能...

我在这里想念什么?

开始使用FB API方法,发现是在DEV MODE上而不是在公共模式下...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM