2014-01-25 76 views
0

我很努力地插入FB分享鏈接。 鏈接正在調用JS。 JS打開一個彈出窗口,我的圖像丟失。Facebook分享按鈕和圖像

我有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,但只有我可以共享它(照片看起來不錯)。其他帳戶不能...

我在這裏錯過了什麼?

回答

0

開始使用FB API方法,發現DEV MODE不在公共模式下...