publish_stream 权限 &应用程序访问令牌?
我一直在挖掘我能找到的所有文档,但我似乎无法验证这一点。
当我进行应用程序授权时,我要求访问者提供publish_stream。 从 FB 文档 (http://developers.facebook.com/docs/reference/api/permissions/):
使您的应用能够将内容、评论和点赞发布到用户的信息流以及用户朋友的信息流中。拥有此权限,您可以随时将内容发布到用户的 Feed,而无需进行离线访问。但请注意,Facebook 推荐用户发起的共享模式。
它非常明确地表明我可以随时发帖。但是,常规用户访问令牌会在一段时间后过期。这样就不能用来发帖了。
但是,可以随时检索应用程序访问令牌,无需任何用户交互。当我进行测试时,我可以使用应用程序访问令牌成功发布到用户源(是的,在他们的源上,而不是我的应用程序源)。 虽然我没有等待 2 个多小时,最初获得的用户令牌就过期了,但即使用户会话已注销,我仍然可以使用应用程序令牌进行发布。
所以,这就是我想要的,对吗?是的!
但这没有在任何地方记录,所以我的问题是:
这是允许/推荐的方法吗?我会遇到这方面的任何问题吗?
谢谢
I've been digging through all docs I can find, but I cannot seem to verify this..
When I'm doing app authorization I'm asking for publish_stream from my visitor.
From to FB docs (http://developers.facebook.com/docs/reference/api/permissions/):
Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends. With this permission, you can publish content to a user's feed at any time, without requiring offline_access. However, please note that Facebook recommends a user- initiated sharing model.
It very explicitly states that I'm able to post at ANY time. But, a regular user access token expires after a certain time. So that won't be usable to post.
However, an APPLICATION access token can be retrieved at any time, without any user interaction. And when I've tested, I can successfully publish to a users feed (yes on their feed, not my applications feed) using the app access token.
I haven't waited 2+ hours for the initially obtained User token to expire though, but even if the user session was logged out, I was still able to post using the app token.
So, this is what I want, right? Yes!
But this is not documented anywhere, so my question is:
Is this an allowed/recommended approach? Will I run into any problems around this?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是正确的方法,因此您不会遇到任何问题等。
只需使用应用程序 access_token 即可在您的应用程序用户墙上发布。
问候,
弗雷迪
this is the right way to do it, so you'll not run into any problems etc.
Just use the App access_token to publish on you app users walls.
Greetings,
Fredyy