你如何找到某人的Facebook ProfileID?

时间:2014-06-23 06:43:56

标签: ios facebook

我正在开发一个iOS应用程序,它将人们的个人资料图片加载到FBProfilePictureView的一个实例中,该实例具有profileID属性。有没有办法轻松找到某人的profileID?

2 个答案:

答案 0 :(得分:0)

为什么不使用Facebook Tool?您可以拥有ID和其他一些信息(以JSon格式),只关注在URL中替换用户名的人。

答案 1 :(得分:0)

我是否应该在评论或答案中存在冲突,但这是如何:

您使用Open Graph API found here

http://graph.facebook.com/username的调用会返回一堆Json,您可以从中获取id值。

所以,http://graph.facebook.com/facebook返回:

{
   "id": "20531316728",
   "about": "The Facebook Page celebrates how our friends inspire us, support us, and help us discover the world when we connect.",
   "can_post": false,
   "category": "Product/service",
   "checkins": 348,
   "cover": {
      "cover_id": "10152513030211729",
      "offset_x": 0,
      "offset_y": 62,
      "source": "https://scontent-b.xx.fbcdn.net/hphotos-xfp1/t31.0-8/q71/s720x720/1553497_10152513030211729_1664524928_o.jpg"
   },
   "founded": "February 4, 2004",
   "has_added_app": false,
   "is_community_page": false,
   "is_published": true,
   "likes": 152791404,
   "link": "https://www.facebook.com/facebook",
   "mission": "Founded in 2004, Facebook\u2019s mission is to give people the power to share and make the world more open and connected. People use Facebook to stay connected with friends and family, to discover what\u2019s going on in the world, and to share and express what matters to them.",
   "name": "Facebook",
   "parking": {
      "lot": 0,
      "street": 0,
      "valet": 0
   },
   "talking_about_count": 2149385,
   "username": "facebook",
   "website": "http://www.facebook.com",
   "were_here_count": 0
}