As mentioned, for example, my name is Nicholas, I have 200 friends, and I'm able to get a list of my friends with no problem. Now I want to choose one of my friends and retrieve their friends list, I'm using
get_connection(friend_name , "friends")
my controller is
get_friend_friennd_list(friend_name)
and in my view
get_friend_friend_list_path(friend['name'])
however, it gives me an error, anyone know how to do it? Any hints?
You can't get friends of a friend on Facebook. If you try, Facebook will give you an error:
"(#604) Can't lookup all friends of XXXX. Can only lookup for the logged in user or the logged in user's friends that are users of your app.",
Related
In fb-sdk 3.x. I was able to get request id after user has sent requests to their friends(usingFBWebDialogs) this way I could show in my app that user has invited friends which improved user experience because user got confirmation that invites were sent.
Now with fb-sdk 4.0(using FBSDKAppInviteDialog) I don't receive any data which would enable me to show invited friends.
Do you have any suggestions how to get list of invited friends?
There is no way to get list of invited friends.
The issue was discussed with Facebook engineer Emil Hesslow at Facebook Developer Community group. Here is relevant part of one of his comments:
And if they expect their friends to show up in the app it is just
because it was working like that before. Not because everyone always
assumes that will happen if you invite someone.
And no you can't get who they invited
I have a rails app that uses omniauth for Facebook login. I also use fb_graph to get the user's friends list. Instead of displaying ALL of the current_user's friends, I only want to display his friends who have used my app before.
The way I am thinking of doing this is adding a field to my user model that I can check in the view that I display the friends from. So for example
graph_user = FbGraph::User.me(current_user.oauth_token)
#friends = graph_user.friends
in the controller. Then in the view I can have:
#friends.each do |friend|
- if User.find_by_uid(friend.uid)
# display that friend
unfortunately, 'friend' doesn't have a uid but users who are authenticated obviously do. Is there something I can request from Facebook upon creating a new user, maybe email?, that I can check later against 'friend.'
Would checking email be ok? Currently we don't request email from Facebook login, but if I did, I don't think friend.email would allow me to collect that either, would it? What is a better way?
EDIT: I found this other SO post that says I can grab access tokens from friends or something, but I don't really understand, maybe someone could shed some light or point me to a tutorial?
Thanks
You can use fql directly to get the friends who use the app. I'm not sure how to use fql in ruby but this post might help you- Facebook FQL Query with Ruby
The query to get the friends who use the app-
SELECT uid FROM user WHERE is_app_user=1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
(user table)
I am trying to get checkin information of a user's particular friend in my application. In application, user authenticates to foursquare at the start which make me able to get his/her friend list.
I am getting the friend list with this API end point : https://api.foursquare.com/v2/users/self/friends. According to documentation it's response should include user objects which should have include checkins field but it seems there is no checkins field in the response. I can get other informations like first name, bio etc.
I also tried this API endpoint with user ID of friend which I want to get information of https://api.foursquare.com/v2/users/USER_ID/checkins but it returns an error states that I am not authorized for getting this information.
What am I doing wrong? Should I be authorized for this information since the information is about checkins of user's friends?
Thanks in advance.
Unfortunately this isn't a use case that's supported very well by the API. The way to see a list of check-ins of a particular user is through users/self/checkins. This will return the check-ins of the owner of the OAuth token that made the call.
As stated here https://developer.foursquare.com/docs/users/checkins:
USER_ID | self | For now, only self is supported
I am looking to combine a call to Facebook Graph API. I would like to collect both the friends and profile information in one go.
I have also raised a separate question issue here - Facebook SDK collecting user information and friends
What is the correct/easiest way to create a Facebook Graph request for both these parts?
The user is logged in with this permission array:
NSArray *permissionsArray = #[ #"user_about_me", #"user_birthday", #"user_location", #"email"];
I am then trying to create a graph connection to get information 'such as' username, email, friend list. Ideally I want to do this in one FBRequest, rather than separate FBRequestConnection(s). How can I accomplish this? I have looked through the Facebook SDK information and cannot see how to do this, how can I find out more information on this?
You can get all of this information in one API call to:
/me?fields=id,username,email,friends
I'm not sure of the syntax for iOS.
If you want more data about your friends, you can specify fields through field expansion, like this:
/me?fields=id,username,email,friends.fields(id,name,username,birthday)
I want to Scan Facebook friends list and find potential relationship between Facebook user and potential friend.After login I will give a user id then the system should find out the whether he is a friend any of my friend or friend's friend.Loop friend’s friend list up to 3 levels. If there are matches present data in hierarchical format.My application was in Asp.net mvc3. Can you please suggest me a solution .
You need user_relationships permission for your needs , Refer this documentation https://developers.facebook.com/docs/reference/login/user-friend-permissions/