使用 localhost 作为 Canvas URL 不起作用
我正在尝试开发一个简单的桌面应用程序,以使用 Java 的 restfb
api 在我的墙上发布帖子。到目前为止一切正常,但其他用户看不到我的帖子,只有我自己。在阅读了其他一些文档后,我发现像这样的 HTTP 请求
https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream,publish_stream
用于编辑我的应用程序的公开设置。正如我之前提到的,它是一个本地桌面应用程序,背后没有任何网络服务器,所以我想使用 localhost 作为画布 URL,因为上面的链接需要它。我只是使用 http://localhost:8080/
作为我的站点、画布和安全画布 URL。在上面的 HTTP 请求中使用这些信息后,我收到错误,请求的链接不起作用。我的帖子仍然无法被其他人阅读。
您有什么建议来解决这个问题吗?
I'm trying to develop a simple desktop application to publish posts on my wall using restfb
api for Java. It works fine so far, but other users cant see my posts, only me. After reading some other documentation, I found out that an HTTP request like:
https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream,publish_stream
is used to edit the publicity settings of my applications. As I mentioned before, it's a local desktop application without any webserver behind it, so I want to use the localhost as a canvas URL, because its needed in the link above. I simply used http://localhost:8080/
as my site-, canvas- and secure canvas url. After using these informations in the HTTP request above I get the error, that the requested link doesnt work. My posts still can't be read by others.
Do you have any suggestions to solve that problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一旦您与 Facebook 合作,您的本地主机只能在您的计算机内使用,您最多可以向他们提供全局 URL。
尝试用 你的 ip 替换 localhost
Your local host can only be used inside you machine once you are working with facebook you most provide them a global url.
Try replacing localhost with your ip
这里同样的问题。还要补充一点。
更新:我通过更改我的个人 Facebook 帐户(我的应用程序发布到的帐户)的隐私设置下的默认隐私设置来使其正常工作。我将其设置为“自定义”,并选择了“仅限我”。对于我们的应用程序来说,这将是一个很好的常见问题解答项目。我想我们可以将该设置视为全局覆盖。
Same problem here. A little more to add.
Update: I got it to work by changing the Default Privacy setting under Privacy Settings of my personal Facebook account - the one to which my app was posting. I had it set to Custom with "Only Me" selected. That would be a good FAQ item for our apps. I guess we can think of that setting as a global override.