Facebook Feed对话框错误191
Facebook Feed Dialog error 191
所以,我试图使Facebook Feed对话框通过他们的API工作,但到目前为止还没有成功。
我使用Facebook Javascript SDK来做它,和FB。用户界面方法。
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'MY FB APP ID',
xfbml : true,
version : 'v2.3'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<script type="text/javascript">
function fbShare(url, title, descr, image) {
FB.ui({
method: 'feed',
name: title,
link: url,
caption: 'Title',
description: descr,
picture: image,
display: 'popup',
redirect_uri: url
},
function(response) {
if (response && response.post_id) {
//alert('Post was published.');
} else {
//alert('Post was not published.');
}
});
}
</script>
我的链接是这样的:
<a href="javascript:fbShare('http://mywebsite.com/avaliacao/9d8ee3cb3ad759b134da94802e7c49c8', 'My Site Has a new share', 'Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content.', 'http://mywebsite.com.br/img/fb-share.png')">Share</a>
点击共享链接时给出的错误:
发生错误。请稍后再试。
API错误码:191.
API错误描述:指定的URL不属于应用程序。
错误信息:redirect_uri不属于应用程序。"
删除redirect_url
后重试。或者确保在应用程序设置(http://mywebsite.com/)中添加redirect_url
的域作为网站平台。
我最后使用了另一种方式来使用提要对话框。
Javascript:<script type="text/javascript">
function fbShare(url, title, descr, image, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open('https://www.facebook.com/dialog/feed?app_id=APP-ID
&name=' + title
+ '&picture=' + image
+ '&caption=My+Caption
&display=popup' + '
&description=' + descr + '
&link=' + url + '
&redirect_uri=http://mywebsite.com.br/fb-close-popup-window',
'sharer',
'top=' + winTop + ',
left=' + winLeft + ',
toolbar=0,
status=0,
width=' + winWidth + ',
height=' + winHeight);
}
</script>
HTML <a href="javascript:fbShare('http://mywebsite.com/9d8ee3cb3ad759b134da94802e7c49c8','My Site Has a new share','Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content.','http://mywebsite.com.br/img/fb-share.png',520, 350)">Share</a>
相关文章:
- jQuery UI对话框错误,按钮导致HierarchyRequestError
- 在引导盒对话框中使用 Blaze.render - 得到奇怪的错误
- 动态创建的 jQuery UI 对话框错误后 jQuery 2.2.0 升级
- 检查对话框是否为 Open 会引发“初始化前无法在对话框上调用方法”错误
- 动手错误:在 jquery UI 中启动时,对话框是不可编辑的
- 生成对话框angularjs时出现DialogProvider错误
- JQUERY对话框未捕获错误:初始化之前无法调用对话框上的方法
- Facebook发送对话框类型错误
- 对话框函数错误无效函数
- 将html保存为xls-JS保存对话框错误
- 未捕获错误:初始化前无法在对话框上调用方法;尝试调用方法“打开”
- j查询验证重置表单错误,当我关闭对话框
- “Jquery”对话框错误
- jquery 中的对话框错误
- 对话框出现错误“ 未捕获的类型错误: 无法读取未定义的属性'sdIntContent'”
- 对话框给出类型错误
- Delphi-can't在多线程应用程序中使用IWebBrowser2来抑制JavaScript错误对话框
- 未捕获的类型错误:$(…).对话框不是创建对话框时的函数错误
- jquery为错误对话框设置了一个新的CSS类
- 命令中的触发 Elfinder 错误对话框