使用 Facebook Graph 只需使用 javascript 即可发布留言墙
在 Facebook 中,我如何在用户墙上发布一条消息,说“我在物体游戏上得了 8/10”,然后发布一个 URL?
我真的不想使用完整的 API,因为我不想处理用户登录详细信息。我不介意 Facebook 是否需要进行身份验证然后发布消息。
是否可以使用新的 Graph API 和 JavaScript?
In Facebook how can I post a message onto a user's wall saying "I scored 8/10 on objects game" then a URL?
I really don't want to have to use the full API, as I don't want to handle user login details. I don't mind if Facebook needs to authenticate and then post the message.
Is it possible using the new Graph API and JavaScript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
注意 4/16/2011:stream.publish 似乎已被弃用,有一种新方法可以做到这一点:http://developers.facebook.com/docs/reference/dialogs/feed/
您可以使用类似的内容发布到墙上,用户需要发送前确认。
不要忘记您需要使用 FB.init 并包含 JS SDK 链接。
Note 4/16/2011: stream.publish seems to have been deprecated, There's a new way to do this: http://developers.facebook.com/docs/reference/dialogs/feed/
You can use something like this to publish to a wall, the user will need to confirm before it get sent.
Don't forget that you'll need to use FB.init and include the JS SDK link.
在墙上发布将显示一个对话框,用于选择是否在墙上分享消息。但我想将消息默默地发布在用户的墙上,假设用户已经授予“在墙上发布”权限。
Post on wall will show a dialog box to share the message on wall or not. But I wanted to post the message silently on user's wall, assuming that user had already given "Post on wall" permission.
考虑到您有一个代理来进行跨域调用,您可以简单地执行此操作...
在此示例中,YourProxyMethod 采用类似 jQuery.ajax 的哈希,使服务器端发布并发送请求。返回成功/错误回调中的响应。任何常规代理都应该这样做。
诀窍是在 URL 中包含 app_id 和 access_token。
此外,您的 FB 应用程序应该有足够的权限来进行此调用。
Considering that you have a proxy to make cross domain calls, you can simply do this...
In this example, YourProxyMethod takes a jQuery.ajax like hash, makes a server side post & returns the response in success/error callbacks. Any regular proxy should do.
The trick is to include app_id and access_token in the URL irself.
Also, your FB app should have sufficient permissions to make this call.