我们可以使用Graph API在朋友墙上张贴照片 [英] Can we post photos on friends wall using Graph API

查看:361
本文介绍了我们可以使用Graph API在朋友墙上张贴照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在朋友墙上上传照片吗?文档从来没有提到!但它的发生。 我可以发布到 / friend_id /照片连接。

Is it possible to upload photos on friends wall? The documentation never mentioned that! but its happening. I am able to post to the /friend_id/photos connection.

我是实际上使用localhost隧道在本地服务器上运行我的应用程序。所以,8月份,我做了一个应用程序,人们可以在他们的朋友墙上张贴照片(仅根据他们的要求)。所以,由于我是FB API的新手,我没有注意到这是不允许的。

I am actually running my app on local server using localhost tunneling. So, in August, I made an app where people can post photos on their friends wall (upon their request only). So, As I was pretty new to FB API, I didn't notice that it is not allowed.

我刚刚离开了这个应用程序几个星期,回来修复了,我注意到我无法将照片发布到 / friend_id / photos 连接(它只是不工作,我没有得到任何错误)。它甚至不适用于其他可能连接,例如 / friend_id / feed 我的应用程序是否仅限于某些图形操作?

I just left the app for few weeks and came back to fix things and I noticed that I am unable to post photos to the /friend_id/photos connection (Its just not working. I am not getting any errors). Its not even working for other possible connections like /friend_id/feed Is my app restricted to some graph actions?

所以,我刚刚创建了一个测试应用程序,并执行了相同的连接 / friend_id / photos 和**它的工作。不知道为什么!**

So, I just created a test app and executed the same connection /friend_id/photos and **its working. Don't know why!**

这不是惊喜的结局:



  1. 当我打开照片时,我可以从Surya的照片中看到它 - 我的照片

  2. 我的相册中没有看到这张照片。我只是不知道其实际保存的地方。

推荐答案

更新2:确实有可能(是一个错误吗?)同样的常规方式。

Update 2: This is indeed possible (is it a bug?) the same regular way.

但是似乎将照片发布到其他用户的 /照片连接行为与发布到 / me / photos 的行为截然不同。以下是关于发布到 / FRIEND_ID /照片的一些事实:

But seems that posting of photo to other user's /photos connection behave very differently from posting to /me/photos. Here are some of the facts about posting to /FRIEND_ID/photos:


  1. 每个照片以这种方式发布,创建分开的专辑名为发布用户的照片(这是上传的照片将永远不会分组,没有

  2. 照片不会在用户或朋友的相册中看到,但是只有通过饲料/时间轴才能看到/访问。

  3. 确实这只有在您能够发布在该朋友的饲料上才有效。

  1. Every photo published that way creates separated album named Posting User's photos (that's it uploaded photos will never be grouped and there is no way to see all of them in single place).
  2. That photo will not be visible in albums of either user or friend, but only will be seen/accessible via feed/timeline.
  3. And for sure this is only working if you able to post on that friend's feed

所以它的行为就像朋友的饲料之间的任何其他内容一样。

So it really behaves just like any other content posted to friend's feed.

如果你不依赖这些照片的专辑功能和持久性,只想在朋友的墙上分享照片,去除它(除非被证明是错误的)。

I would say if you not rely on album functionality and persistance of those photos and only want to "share" photo on friend's wall, go for it (unless it's proven to be bug).

TL; DR; 不,您不能发布照片给朋友的 /照片连接嗯,你可以发布照片给朋友的 /照片连接,但如果发布到您的 /照片,则不会有相同的方式。

TL;DR; No you cannot post photo to friend's /photos connection. Well, you can post photo to friend's /photos connection but it will not behave the same way if posted to your's /photos.

根据 照片 用户 的连接:

According to documentation of photos connection for user:


创建

您可以通过发布将照片发布给用户的墙壁使用publish_stream权限和以下参数的PROFILE_ID /照片的HTTP POST请求。

Create
You can post photos to a user's Wall on their behalf by issuing an HTTP POST request to PROFILE_ID/photos with the publish_stream permissions and the following parameters.

还根据 照片 对象:

Also according to documentation of photo object:


https://graph.facebook.com/USER_ID/photos - 照片将被发布到为您的应用程序创建的专辑。如果您的应用不存在,我们会自动为您创建相册。所有上传的照片将被添加到同一张专辑中。

https://graph.facebook.com/USER_ID/photos - The photo will be published to an album created for your app. We automatically create an album for your app if it does not already exist. All photos uploaded this way will then be added to this same album.

所以一般来说,你试图将照片上传到其他用户的相册,您可能只能将照片发布到您的个人资料(或者如果使用 access_token )页面,则可以张贴照片。

So generally speaking you trying to upload photo to other user's album but you may only post photos to your profile (or to page if using access_token for page).

发布到 feed post 可能或可能没有图片作为附件,这是不一样的作为照片)。

You may however post to feed of other user (for example post may or may not have picture as attachement, which isn't the same as photo).

更新:
照片可能只能上传到 / USER_ID /照片 USER_ID 我相同(所有者 access_token )。

Update: Photos may only be uploaded to /USER_ID/photos than USER_ID is the same as me (owner of access_token).

这篇关于我们可以使用Graph API在朋友墙上张贴照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆