Get friend app user with graph API - facebook

I want to get friend app user with Graph API I tried to user with me/friends?fields=installed but I got all of my friends. Maybe, I have some wrong in here. Please show me any way to get friend app user with Graph API. I don't know in Facebook SDK 3.0 can I get that list easier?

You can get list of friends whom are user of your app using FQL rather than Graph API as:
SELECT uid FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
AND is_app_user = 1

Related

Get friend list from facebook who downloaded the app in android using parse

I am developing the app which is login through the facebook account using link
and use the parse to store data in backend Parse Facebook Example
My requirement for this app is to get Facebook Friend List who downloaded this app on there phone ...
I am getting the the Friend List but I still don't know how to get the who downloaded this app from my friends...
I am getting the friends facebook Id but It didn't get the user other profile information like name
Could anyone tell me how to get this...
Thanks.
You need to let people be able to "connect" their facebook account with your app. When they do, store their facebook id in your User table. Then you can get a person's friends list and then query your Parse database to see if any of those user IDs match people who have stored their facebook ID.
For more info, check this answer: Replicating parse.com anypic in JavaScript - Unable to compare Fb users
You can use the FQL query to get the friends who are using the app-
SELECT uid FROM user WHERE is_app_user=1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
Demo: https://developers.facebook.com/tools/explorer?fql=SELECT%20uid%20FROM%20user%20WHERE%20is_app_user%3D1%20AND%20uid%20IN%20(SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20%3D%20me())

getting facebook friends list who have installed an app

It's possible to know the facebook friends that they have installed a my fb app?
I have tried some ways directly using the online facebook developer tool but I have not been able to find a solution. I have tried both Graph API and FQL
Using FQL:
SELECT uid, name, is_app_user FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())
AND is_app_user=1

fql not working

I have used a fql for get my friends information
SELECT uid,name,first_name,middle_name,last_name,pic_square,hometown_location,current_location,profile_url,email,website FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
it returning only friends id an name. Who have trusted my app there location also comming but when I am puting this fql on the Graph API Explorer
on facebook then it returns every one's location. Then How Can I get every one's location ?
It is hard to understand your question, though it looks like your app doesn't have all the required user permissions. The Graph API explorer, or the developer page are great resources to figure out which ones you need.
Hometown location,current location, email, and website are not "basic" data.

Getting friend_likes in a single API call

For a single user of my app, I want to find the likes of all his/her friends. Assuming my app requires the user to approve the app access to the friends_likes permission, is it possible to get the likes of all his/her friends in a single (or a few) API calls? This article suggests I have to make one call per friend of my user; I'd like to avoid this if possible since one user may have upwards of 1000 friends. Thanks.
Yes. You could do it in one FQL query:
SELECT name, page_id
FROM page
WHERE page_id IN
(SELECT page_id
FROM page_fan
WHERE uid IN
(SELECT uid2 FROM
friend
WHERE uid1 = me()
)
)

Friends of Friends/2nd degree friend's list. Facebook Graph API

I am trying to get a list of my friend's friends using the iPhone Facebook SDK.
I've tried an approach using FQL and the Graph API but I get an error in both cases:
"Can't lookup all friends of YYYYYY. Can only lookup for the logged in user (XXXXX), or
friends of the logged in user with the appropriate permission"
I've done some research and see that this functionality wasn't available through the Facebook API up until October 2010. But then radio silence. Well, it's almost 6 months later. So was this ever implemented?
I have requested all permissions I need for my app as well.
This functionality does not exist in the Facebook Social Graph API or the FQL API.
During my quest to find out how to accomplish this I found many developers who asked the same question. Some developers have been asking for this feature for over 2 years. I think the FB team may consider it a privacy of performance concern.
I have worked on it. I was able to see friends of my friend.
It needs following requirements:
Your friend needs to be using application.
Permission from application read_stream, publish_stream, publish_checkins.
Try this fql query.
$query="SELECT uid, name, work_history FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 IN
( SELECT uid FROM user WHERE uid IN
(SELECT uid2 FROM friend WHERE uid1 = $fb_id ) and is_app_user=1)
)";