Android 应用程序上的 facebookpublish_stream 与offline_access
我正在制作一个发布 Facebook 帖子的 Android 应用程序。我希望它在用户按下“发送”按钮时发布帖子。
根据Facebook开发者权限页面,offline_access权限 “使您的应用程序能够随时代表用户执行授权请求。默认情况下,大多数访问令牌会在短时间内过期,以确保应用程序仅在积极使用应用程序时代表用户发出请求。此权限使我们的 OAuth 端点返回的访问令牌长期存在。”
Facebook 开发者页面将“publish_stream”权限描述为“使您的应用能够向用户的流以及用户朋友的流发布内容、评论和点赞”。有了此权限,您可以随时将内容发布到用户的源,而无需进行离线访问。但是,请注意 Facebook 推荐用户发起的共享模型。”
因此,据我了解,要将帖子发送到 Facebook 墙,我只需要“发布流权限”但是,当我只要求“publish_stream”权限时,我的访问令牌只是短暂的(两个小时)
谁能解释一下我如何在不使用“offline_access 权限”的情况下随时发布到 Facebook?
I am making an android app that publishes facebook posts. I want it to publish posts anytime the user presses the "Send" button.
According the the Facebook developer permissions page, the offline_access permission
"Enables your app to perform authorized requests on behalf of the user at any time. By default, most access tokens expire after a short time period to ensure applications only make requests on behalf of the user when the are actively using the application. This permission makes the access token returned by our OAuth endpoint long-lived."
The Facebook developper page describes the "publish_stream" permission as 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."
So, as I understand it, to send posts to the Facebook wall I should only need the "publish stream permission" However when I ask for just the publish_stream" permission my access token is only short-lived (two hours long)
Can anyone explain how I can post to the Facebook at anytiome without using the "offline_access permission"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发布流允许您发布到用户墙。这是制作墙柱所需要的。
为了使您的访问令牌持续时间较长,您还需要请求离线访问。这不允许您发布到用户的墙上,它只是确定您的令牌持续多长时间。
就您而言,您可能需要离线访问和发布流。
Publish Stream allows you to publish to the users wall. This is needed to make wall posts.
In order for your access token to last more than a short duration you need to also request offline access. This doesn't allow you to post to the user's wall it just determines how long you token lasts.
In your case, you probably want both offline access and publish stream.