12
I have solved this problem in very easy way
Step 1= first download FbGraph API
Step 2= use this code for authentication
NSString *client_id = @"XXXXXXXXXXXXXX";// App id
//alloc and initalize our FbGraph instance
self.fbGraph = [[FbGraph alloc] initWithFbClientID:client_id];
//begin the authentication process.....
[fbGraph authenticateUserWithCallbackObject:self andSelector:@selector(fbGraphCallback:)
andExtendedPermissions:@"user_photos,user_videos,publish_stream,offline_access,user_checkins,friends_checkins"];
Step 3= Copy fbGraphCallback: Method from sample code and put in your controller
Step 4= Use this code to get Friends and it will give u the list of friend and who have same app install They look like
{
"installed": true,
"id": "{USER_ID_GOES_HERE}"
},
Code is =
NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:4];
[variables setObject:@"installed" forKey:@"fields"];
FbGraphResponse *fb_graph_response = [fbGraph doGraphGet:@"me/friends" withGetVars:variables];
NSLog(@"getMeinstalled Friends: %@", fb_graph_response.htmlResponse);
Thats it!!!!!!!!
I know 'iphone' is tagged in the question, but still this answer might help others who will reach here:
The FQL query to get (just) the ids of all user's friends who are also users of the app is:
SELECT uid FROM user WHERE is_app_user=true AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me())