FB.ui feed 不提供回调
我无法从我的 Facebook FB.UI() 方法获得任何反馈。我确信我正确使用了它,因为实际的帖子确实发布到了我的墙上,但回调数据要么丢失要么为空。我正在使用:
FB.ui({
method: 'feed',
name: 'asd',
link: 'asd',
picture: '',
description: 'asd'
}, function(response) {
console.log(response);
if(response.post_id) {
$.post("ajax/wall.php",{wall : 1});
} else {
}
}
);
I am unable to get any feedback from my Facebook FB.UI() method. I am convinced that I am using it correctly, as the actual post does post to my wall, but the callback data is either missing or empty. I am using:
FB.ui({
method: 'feed',
name: 'asd',
link: 'asd',
picture: '',
description: 'asd'
}, function(response) {
console.log(response);
if(response.post_id) {
$.post("ajax/wall.php",{wall : 1});
} else {
}
}
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我不确定这个问题是如何解决的,但它确实:)
我清除了缓存并将代码更改为下面的内容并且它起作用了(但是我不相信代码的更改实际上对它:
I am not sure how this resolved itself, but it did :)
I cleared my cache and changed my code to below and it worked (however I don't believe the change of code actually played any influence on it:
我也遇到了同样的问题,并且一直无法从 Facebook 获得回调函数的响应。我在 console.log 中没有看到任何内容,也没有在函数中看到任何警报。
我的解决方案是在FB.ui的redirect_uri中放置一个URL,该URL通过self.close(或window.close)转到HTML页面。 FB.ui 弹出窗口在用户输入后重定向到那里并立即关闭。请记住更改 FB 应用程序的站点 URL 设置,使其与文件所在的域相匹配。
这是我的代码,与表单的提交操作相关。函数(响应)回调仍然存在,但未使用。如果有人发现语法错误,请对其进行评论。
self.close.html 中的代码行:
I have the same problem and have never been able to get a response from Facebook for the callback function. I don't see anything in console.log or any alerts I insert in the function.
My solution was to put a URL in FB.ui's redirect_uri that goes to an HTML page with self.close (or window.close). The FB.ui popup redirects there after the user's input and immediately closes. Remember to change your FB app's Site URL setting so it matches the domain the file resides on.
Here's my code, tied to my form's submit action. The function(response) callback is still there but not used. If anyone sees a syntax error please comment on it.
The line of code in self.close.html:
删除
redirect_uri
项,回调将被触发。几分钟前我遇到了同样的问题,并意识到删除
redirect_uri
解决了这个问题。Remove the
redirect_uri
item and the call back will be fired.I was facing the same issue a few mins back and realized that removing the
redirect_uri
solved it.对于以后遇到此问题的任何人,我遇到了完全相同的问题,并像这样修复了它:
成为
post-view-backdrop div 从来都不是为了包含 fb-root,我只是错过了一个关闭标签。
问题是我的 fb-root 周围的 HTML 格式不正确。我只是凭直觉发现了这一点,这绝对是使用 html 验证器的原因。
For any who encounter this problem later, I had the exact same issue and fixed it like so:
became
The post-view-backdrop div was never meant to contain the fb-root, I just missed a close tag.
The problem was improperly formed HTML around my fb-root. I only found this on a hunch, definitely reason to use an html validator.
对于 Phonegap 上解决此问题的任何人来说——问题出在 fb connect 插件上。它根本不触发回调。
这是来自 FacebookConnectPlugin.m 的代码片段:
我不是 Objective C 程序员,所以我不想解决这个问题,可能必须等到插件完成......
For anyone on Phonegap tackling this issue -- the problem is with the fb connect plugin. It simply doesn't fire the callbacks.
Here's a code snippet from FacebookConnectPlugin.m:
I'm not an Objective C programmer so I'm not trying to solve this, probably have to wait till the plugin is complete...
设置redirect_uri会禁用回调
setting a redirect_uri disables the callback