facebook publish_stream versus offline_access on an android app

喜你入骨 提交于 2019-12-08 13:13:28

问题


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"?


回答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.



来源:https://stackoverflow.com/questions/7948283/facebook-publish-stream-versus-offline-access-on-an-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!