[facebook]我可以使用页面用户将消息从应用发布到墙上吗?

问题描述:

我想使用我的应用程序向墙上发布一些消息. 但是由于某种原因,我的用户希望在墙上显示页面名称而不是用户名. 我以为也许可以使用[使用Facebook作为页面]菜单.http://*.com/questions/2901316/post-to-wall-as-facebook-app-not-as-a-user 但是我错了.在这种情况下,我无法在画布页面中使用我的应用程序. 我看到了youtube应用.他们可以以页面用户的身份发布消息. http://apps.facebook.com/videobox/pages 我想念什么吗? 任何想法都会有所帮助. 谢谢!

I want to post some message to wall using my app. But for some reason, my users want to show the page name instead of user name in the wall. I thought maybe I can use [use facebook as page] menu.http://*.com/questions/2901316/post-to-wall-as-facebook-app-not-as-a-user But I was wrong. In that case I can't use my app in canvas page. I saw the youtube app.They can post the message as page user. http://apps.facebook.com/videobox/pages Do I miss something? Any idea will be help. Thanks!

您要发布到Page的墙上吗?您的应用将需要用户的以下2个扩展权限:

Are you looking to publish to a Page's wall? Your app will need the following 2 extended permissions from the user:

  • publish_stream
  • manage_pages

具有这两个权限,您首先可以获取用户为管理员的所有页面的列表,以及页面的访问令牌,如下所示:

With those two permissions, you can first get a list of all of the pages that the user is an admin of, along with the Page's access tokens as follows:

获取URL: https://graph.facebook.com/me/accounts?access_token= {user_access_token}

GET URL: https://graph.facebook.com/me/accounts?access_token={user_access_token}

有了页面的access_token后,您现在可以按以下方式发布到页面的墙上:

Once you have the Page's access_token, you can now Publish to the Page's wall as follows:

POST URL: https://graph.facebook.com/{page_id}/feed
POST BODY: access_token={page_access_token}&message=Test+Post

我希望这会有所帮助.