我正在做一个在页面中加载为制表符(iframe)的应用程序 我正在使用最新的PHP和JS SDK 在用户授权stream_publish等权限之后,我已经能够使用PHP发布到用户的墙上
现在我的问题是当他在我的标签中显示其中一个按钮时,会发布到用户的墙上 我正在尝试这段代码:
function post_wall()
{
FB.ui(
{
method: 'feed',
name: 'Publish example of www.compilaron.com',
link: 'http://example.com/myapp/files/506625449_thumb.jpg',
picture: 'http://example.com/myapp/files/506625449_thumb.jpg',
caption: 'Example caption',
description: 'Example description to test the post',
message: 'Facebook Dialogs are not easy!',
redirect_uri: 'http://www.facebook.com/myFanPage?sk=app_ID'
},
function(response) {
if (response && response.post_id)
{
alert('Post was published in Wall.' );//+ response.toSource());
}
else
{
alert('Post was not published in Wall.' );//+ response.toSource());
}
});
}
首先,我得到api错误191.然后添加了redirect_uri参数,现在得到api错误100.看起来像我正在使用的代码已经过时了,但找不到一些代码可以发布到用户的墙而不离开粉丝专页,重定向和返回内容(如以下网址所述)
https://developers.facebook.com/docs/reference/dialogs/feed/
另外,如果你有一个JS代码直接发布到用户的feed,没有probs,用户授予了权限......
任何想法?
感谢
答案 0 :(得分:0)
我想我找到了解决问题的方法。
完整的facebook iframe应用程序,包含在php和js中发布共享对话框,状态更新,带ajax等的示例...
http://thinkdiff.net/facebook/iadvance-graph-api-iframe-base-facebook-page-app-development/
答案 1 :(得分:0)
为了使redirect_uri正常工作而不会出现错误191,redirect_uri需要由应用程序拥有。