Facebook对话Feed(显示参数不起作用)

时间:2011-04-19 13:29:37

标签: facebook

我已按照文档将Facebook Feed对话框添加到我的网站。我的一个问题是对话框没有作为弹出窗口打开,即使我将display参数设置为“popup”。

<a class="facebook_icon" href="http://www.facebook.com/dialog/feed?app_id=264179898666332&display=popup&redirect_uri=http://mysite.com/&message=I use Mysite!"></a>

我意识到,要将其显示为iframe,我需要获得用户获取访问密钥的权限。我只想暂时将对话框显示为一个单独的窗口。

任何线索为什么这不起作用?普遍的共识是我现在应该只为UX使用iframe吗?

4 个答案:

答案 0 :(得分:6)

在我发现display=popup 没有以弹出窗口打开对话框之前我认为我有这个问题已经有一段时间了,而不是格式化对话框以便它在弹出窗口中看起来不错

我最终使用Javascript在新窗口中打开它 - 就像这样:

window.open("http://www.facebook.com/dialog/feed?app_id=264179898666332&display=popup&redirect_uri=http://mysite.com/&message=I use Mysite!",
                            "My Window Name", 
                            "height=236, width=516");

您会注意到,如果您现在在display=popupdisplay=page之间切换显示,则弹出格式看起来比页面格式更好如果你在新窗口中显示它。

答案 1 :(得分:1)

根据“显示模式”(https://developers.facebook.com/docs/reference/dialogs/)的Facebook文档,“弹出”属性不会自动为您创建弹出窗口,而只是格式化页面上的内容,使内容看起来最好'弹出'

他们的关键措辞是“用于浏览器弹出窗口不超过400px乘以580px”。他们建议您使用javascript调用弹出窗口并将弹出窗口格式设置为不大于400乘以580

facebook_share_url = 'https://www.facebook.com/dialog/feed?app_id=' + window.settings_fb_key + '&link=' + merchant_url + '&redirect_uri=' + merchant_url + '&display=popup'
window.open(facebook_share_url,'','width=400,height=580')

答案 2 :(得分:0)

类似的东西:

<a class="facebook_icon" href="" target="_blank"></a>

不要忘记您始终可以使用FB.ui方法。只需转到test console,点击示例,然后选择“FB.ui”下的“Feed”:

var publish = {
  method: 'feed',
  message: 'getting educated about Facebook Connect',
  picture: 'http://fbrell.com/f8.jpg'
};

FB.ui(publish, Log.info.bind('feed callback'));

答案 3 :(得分:0)

使用此代码可以使用

FB.init({appId: "Your AppId",show_error:true, status: true, cookie: true}); 

  function postToFeed() { 

    // calling the API ... 
    var obj = { 
      method: 'feed', 
      link: 'https://developers.facebook.com/docs/reference/dialogs/', 
      picture: 'http://fbrell.com/f8.jpg', 
      name: 'Facebook Dialogs', 
      caption: 'Reference Documentation', 
      description: 'Using Dialogs to interact with users.' 
    }; 

    FB.ui(obj, callback); 
  } 

    function callback(response)  
{ 

    } 
相关问题