FB.UI参数不会影响对话框窗口 [英] FB.UI params doesn't affect to dialog window

查看:125
本文介绍了FB.UI参数不会影响对话框窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站上添加 Facebook共享按钮.我在Facebook上创建了应用.跑本地服务器.添加到主机文件 127.0.0.1 dev.mysite.com 中,并添加了域 mysite.com 和网站 http://mysite.com (没有空格)到Facebook中的应用设置.正在尝试:

I want to add Facebook share button to my site. I created app on Facebook. Ran local server. Added to host-file 127.0.0.1 dev.mysite.com and added domain mysite.com and website http:/ /mysite.com(without space) to app settings in Facebook. Trying:

function shareOnFacebook(){
    FB.ui({
        method: 'share',
        display: 'popup',
        title: 'myTitle',
        href: 'mysite.com',
        caption: 'mysite.com',
        picture: 'http://www.picturesource.com/path/picture.jpg',
        description: 'myDescription'
    }, function(response) {
         if(response && response.post_id){}
         else{}
    });  	
}

但是在对话框窗口中,信息填充没有参数,这是我通过函数 FB.UI 发送的.我是否错过了一些必要的权限才能将信息放到对话框窗口?

but in dialog window infromation is filled without params, that i sent with function FB.UI. Did i miss something necessary for having permission to put information to the dialog window?

推荐答案

自API v2.9起,就不再可能自定义提要对话框的内容:

Since the API v2.9, this is no longer possible to customise the content of the feed dialog : https://developers.facebook.com/docs/sharing/reference/feed-dialog#deprecated-params

您唯一可以自定义的部分是"quote"内容,如下所示:

The only part you can customise is the "quote" content, which look like that :

您的代码不起作用,因为即使您通过"FB.init"调用强制使用API​​ v2.5或v2.8,每个新的Facebook APP都使用v2.9:

Your code doesn't work because even if you force the API v2.5 or v2.8 with the "FB.init" call, each new Facebook APP is using the v2.9 :

如果您自己的存储库中没有任何旧的Facebook APP(< v2.9),则无法使用旧的供稿对话框.

If you don't have any old Facebook APP in your own repository (< v2.9), you can't use the good old feed dialog.

这篇关于FB.UI参数不会影响对话框窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆