2

I'm using Eclipse FDT to write a Flex application for facebook on a facebook page. I want to be able to fetch the friends list of that same user and to distinguish between friends who installed the app and friends who didn't.

I searched on stackoverflow and I saw that users did that using the old REST API, the question is can I do that with graph api ?

if it's not possible using graph api at all... so how to do with REST API ?! :)

with the following request:

https://graph.facebook.com/me/friends?access_token?XXX

I can fetch the list of friends of that user. but it doesn't provide a flag if my app is installed. what can I do exactly and how ?!

Thanks!

ufk
  • 30,912
  • 70
  • 235
  • 386

2 Answers2

10

You have two ways to do it, with the graph api and with fql.

Using the graph api you can make a request to: /me/friends?fields=installed which should return a list of users, the ones that have the app installed will have this form:

{
    "installed": true, 
    "id": "USER_ID"
}

The ones who don't have the app will be of this form:

{
    "id": "USER_ID"
}

With FQL use this query:

SELECT 
    uid
FROM 
    user 
WHERE 
    is_app_user 
    AND 
    uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
Nitzan Tomer
  • 155,636
  • 47
  • 315
  • 299
  • I am facing an issue parsing the result of the above call. The graph object contains a FBGraphObjectArray ,i can not parse it because the interface is not exposed. Any idea how can i get around this? – Nitin Garg May 08 '13 at 23:20
  • I have no flex experience (I assume that it's what you're using) and so I can't help with that. – Nitzan Tomer May 09 '13 at 22:02
0

I just answered this question here

Hope this answer helps some one down the line.

Community
  • 1
  • 1
Parth Kapoor
  • 1,494
  • 12
  • 23