使用facebook graph api,获取照片中标记的用户和真实照片
我们有一个基于 Facebook 的应用程序的需求,其中
- 我们需要获取给定的照片。
- 识别该照片中标记的所有用户,然后...
- 获取出现任何标记用户的所有照片。
谁能建议如何使用 facebook 的 graph api 来实现这一点?
感谢和问候
We have got a requirement for facebook based application, wherein
- We need to fetch a given photo.
- Identify all the users tagged in that photo and then...
- Fetch all the photos in which any of the tagged user is appearing.
Can anyone please suggest how to achieve this using facebook's graph api?
Thanks and Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以按照 Graph API 文档 (http://developers.facebook.com/docs/reference/api/photo) 访问照片属性,包括标签。
要获取给定用户的所有照片,您需要请求 user_photo_video_tags 扩展权限当他们授权您的申请时。
如果该过程中涉及的所有照片/用户都属于/已授权您的应用程序,那么它应该可以工作。否则,它可能会充满问题,例如,如果所述“给定照片”不公开(即对“每个人”可见),您将需要识别其所有者并向他们请求 user_photos 权限。同样,朋友可以在照片中标记他们的朋友,因此您不能假设您能够访问任何标记用户的所有照片。
祝你好运! :)
You can access photo properties, including tags, as per the Graph API documentation (http://developers.facebook.com/docs/reference/api/photo).
To fetch all the photos of a given user, you will need to request the user_photo_video_tags extended permission from them when they authorize your application.
If all photos/users involved in the process belong to/have authorized your application then it should work. Otherwise, it could be fraught with problems, e.g. if said "given photo" isn't public (i.e. visible to "Everyone"), you will need to identify its owner and request the user_photos permission from them. Similarly, friends can tag their friends in photos, so you can't assume you'll be able to access all photos of any tagged user.
Good luck! :)