ios sdk facebook graph api,无法将图像发布到facebook页面

发布于 2024-12-17 10:37:17 字数 120 浏览 5 评论 0原文

当我尝试使用图形 api、page_id/photos 以及源和消息参数将图像发布到 facebook 页面时。但发生的情况是它张贴在我的墙上而不是页面墙上。 有人有类似的问题吗? 有人可以为这个问题提供解决方案或解决方法吗?

When I try to post image to facebook page using the graph api, page_id/photos with source and message parameter. But what happens is it posts on my wall instead of the page wall.
Do any one have a similar problem?
Can some give a solution or a work around for this problem..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

九八野马 2024-12-24 10:37:17

根据 facebook 中的文档 (https://developers.facebook.com/bugs/206254392780441),我发布了以下步骤:

  1. 如果您想在 Facebook 页面上发布图像,那么您必须是该页面的管理员意味着非管理员人员无法在 FB 页面上发布任何图片,这可能听起来很奇怪,但这似乎是 facebook 中的某种错误

  2. 您必须使用页面 access_token而不是用户 access_token,这意味着默认情况下,当您使用图形 api 登录时,您会获得一个 access_token,但在这种情况下,您想要发布到一个页面,而不是您的墙或您朋友的墙,因此您需要调用一个 api 来请求页面 您必须使用页面access_token

  3. 您必须使用manage_pages和publish_stream权限使用登录时获得的access_token作为参数调用me/accounts api,因为这些是允许您处理与页面相关的任务的页面权限。

  4. 如果您没有获取页面access_token,则图像将发布到您的FB墙上,因为access_token是用户access_token而不是页面access_token。

另一种解决方法是通过 php 服务器端代码来执行此操作。

As per the documentation (https://developers.facebook.com/bugs/206254392780441) in facebook am posting the steps:

  1. If you want to post an image on facebook page then you have to be the admin of that page which means that non-admin people cannot post any pics on the FB page, this might sound weird but it seems to be some sort of bug in the facebook

  2. You have to use the page access_token and not the user access_token which means that by default you get a access_token when you login using the graph api, but in this case you want to post to a page not to your wall or your friends wall so you need to call one api to request the page acces_token with the help of graph api.

  3. You have to call me/accounts api with the access_token that you have got while login as a parameter using the manage_pages and publish_stream permissions because these are the page permissions that allow you to handle the task related to pages.

  4. If you do not get the page access_token then the image will be posted on your FB wall since the access_token is the user access_token and not the page access_token.

Another work round could be to carry out this via php server side code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文