ios - Fetching facebook friends of user -
i trying fetch facebook friend list of user returning count of friends.bellow code .is there wrong in code?
-(void)loginviewfetcheduserinfo:(fbloginview *)loginview user:(id<fbgraphuser>)user { [fbrequestconnection startwithgraphpath:@"/me/friends" parameters:nil httpmethod:@"get" completionhandler:^( fbrequestconnection *connection, id result, nserror *error ) { nslog(@"me/friends result=%@",result); nslog(@"me/friends error = %@", error.description); nsarray *friendlist = [result objectforkey:@"data"]; //[m_allfriends addobjectsfromarray: friendlist]; }]; }
when registered app facebook. facebook provide 3 permission , these permission default approved
user_friends provides access person's list of friends use app. permission approved default.
according can friend use app. check link https://developers.facebook.com/docs/graph-api/reference/v2.3/user/friends
Comments
Post a Comment