I am using the FB graph api to get a list of my friends' friends using:
https://graph.facebook.com/<id>/friends?access_token=<token>
Now the weird thing is that this works for some of my friends and does not work for some others. Could somebody tell me why this is happening and a possible fix?
In cases where it does not work, I get the following message: "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"
And I repeat, I AM ABLE to get friend lists of some of my friends using the above URL. What permissions are being mentioned here?
In new SDK of the Graph API is not possible to do that.
Take a look here.
Related
I have access-token and using 3.3 version of facebook graph API. I am unable to get the friendlist of user. Can somebody help me to get friend list of person so that I can send them an invitation to install my app.
If it´s a game, you can use the Game Request dialog: https://developers.facebook.com/docs/games/services/gamerequests/
If not, use one of the Sharing Options described in the docs: https://developers.facebook.com/docs/sharing/
There is no way to get the friends with the API anymore, you can only access friends who authorized your App too - with the user_friends permission.
I want to access my facebook friends public posts for some sentiment analysis stuff. Can anyone help in knowing how it can be done using GraphAPI ?
You can´t access data of friends anymore. All friend permissions are gone:
All friends_* permissions have been removed.
Source: https://developers.facebook.com/docs/apps/changelog
Additionally to the removal of the friends_* permissions, you can no longer get the whole friend list anymore, but only those who are also using your app.
So, what you want to achieve is unfortunately pretty much impossible.
I do the call:
FB.api('/me/friends', function(response) { console.log(response);});
I see in the console log response as and object with empty data and correct summary:
Object { data=[0], summary={...}}
Where summary is (the number of my friends):
Object { total_count=444}
I know that friends edge call has been changed through APi v2.1. It works in Graph API explorer. I hve specified permissions for the requested operation before:
<fb:login-button scope="user_friends" onlogin="checkLoginState();">
</fb:login-button>
What am I doing wrong?
You misunderstand what the user_friends permission is for. This is taken from the docs about the user_friends permission:
user_friends
Provides access the list of friends that also use your app. These friends can be found on the friends edge on the user object.
In order for a person to show up in one person's friend list, both people must have decided to share their list of friends with your app
and not disabled that permission during login. Also both friends must have been asked for user_friends during the login process.
Review
Your app may use this permission without review from Facebook.
Common Usage
Use the list of friends to create a social experience in your app.
If I have understood it correctly Facebook made some changes so it returns app_scoped_id instead of the normal user_id.
The problem I have now is that no other function seems to work.
I receive an I id from Facebook, and it's the same each time I login, but if I use facebook.request("me/friends") the table is empty, if I use facebook.showDialog("friends") it
What do I need to do in Corona SDK to get this to work? Before I could use these functions after having setup them up in Facebook.
I read this thread explaining why this happen but it doesn't explain how to solve it in Corona SDK: Get Users App-Scoped user id in Facebook Graph API
As of Facebook API v2.0, friends list (/me/friend) returns ONLY user's friends who are already using your application. This limitation applies to all apps that are on v1.0 mode too.
If you're looking to get friends for tagging actions: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/taggable_friends
If you're looking to get friends for inviting to a Facebook Game on Canvas: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/invitable_friends
Cheers!
If I have an access token for a Facebook user, is there a way to see which of their friends are going to an event? I'd like there to be a way to filter https://graph.facebook.com/<event_id>/attending/?access_token=<a_t> to only return friends of the user whose access_token is provided.
If you also include the friends_events permission with your token you can get the list of friends attending. I just verified in the Graph API Explorer that this permission and {event id}/attending will work like a charm.
Another way would be to use FQL, but it will be messier.