Facebook Graph API: Relationship status of Friends of Friends - facebook

Running into an issue, which most likely is a permission thing with Facebook, but still worth asking on the forum. I'm able to successfully get the friends of the logged in / authorized user and can traverse the friends of that friend (if they've also installed the app).
So far, so good - however, I'm not able to peek at the relationship_status of the friends of friend - checked with the permission set and we seem to have the required perms as well.
The following are the perms I'm requesting from the user who signs up,for friends:
email,friends_relationships,friends_birthday,friends_about_me
Any ideas on what we might be missing? Am about to put this down to a per-user permission issue - but even friends with very low security don't have this attribute showing - which makes me feel that I'm missing some permission.

This won't work as there is no extended permissions for friends of friends. The only option would be to collect this information from the logged in user and their immediate friends, and then build this information up yourself as more people authenticate with your application, and then check to see what you know in your own database about friend of friends.

Related

Facebook GRAPH API - user's friends list does not return any data except total count

I created several test users in my App in Facebook developer account and granted all of them user_friends permission and also connected them together through 'Manage user's Facebook friends' option. However when I try to retrieve one of those user's friends list, it returns only total count of friend, but not their data .. Does anyone know why is that happening ? Thank you in advance..
Test users list
me/friends request and response
Granted permissions to test users
Its a known bug of Facebook which has been reported here for app type Consumer/Business.
https://developers.facebook.com/support/bugs/721152122632278/
https://developers.facebook.com/support/bugs/615773773588521/
But you won't have any issue if your app time is Gaming Service, or you create a test app of your main app but don't forgot to create test users, assign them 'user_friend' permission and add them as a friend with each other. I followed the same process after going through alot of research and finally it worked.

Get facebook posts from group from others if I am NOT admin

SO, I belong to some facebook group. I am not admin and I want to get all posts from that group by others,
Idea is to filter those and get notification when someone posts something that passes filter.
Example, to get notification when post containing string "laptop" is posted.
Like this:
http://i.stack.imgur.com/yjaYT.jpg
I tries looking into facebook API but cannot find anything if I am not admin...
https://developers.facebook.com/docs/graph-api/reference/v2.2/group/feed
You can read the feed of a group with a User Access Token of any user that is member of the group, not sure what you found for Admins but they don't even get mentioned in the docs.
Keep in mind that you need the user_groups permission, and you will most likely not get it approved:
This permission is granted to apps building a Facebook-branded client on platforms where Facebook is not already available. For example, Android and iOS apps will not be approved for this permission. In addition, Web, Desktop and TV apps will not be granted this permission.
Source: https://developers.facebook.com/docs/facebook-login/permissions/v2.2

Facebook friends list is empty, just for one specific user

Simply executing this query aiming to list all my friend's friends:
GET https://graph.facebook.com/hisFacebookUserId/friends?return_ssl_resources=1&access_token=hisAccessToken
I obtain an empty data entry. => as if it had 0 friends. (but he has 800).
However, it works for many other users.
What might be the reason?
Since v2.0 of the Facebook API, you can only get the friends who authorized your App too. It´s a (privacy) feature, not a bug.
https://developers.facebook.com/docs/apps/changelog
Also, it´s not necessary to use an ID for the call, because you can only get the friends of the authorized User anyway:
/me/friends
Btw, don´t forget to authorize Users with the user_friends permission.

publish_actions extended permissions for posting to Facebook Timeline

I am trying to create an action on an article so when a user, who has authorized the app lands on article, it publishes the fact they've read the article to their timeline.
This works for me without issue but when anyone else tries it, they get an error along the lines of
Requires extended permission: publish_actions
I saw a notice on Facebook saying :
While in Open Graph Beta, the 'publish_actions' permission can only be
requested from developers and test users of your app. The
'publish_actions' permission will be ignored if requested from any
other user.
However, the likes of Spotify, Guardian and Independent utilize pretty much exactly what I need. How come? What are they doing differently to me?
You have to submit your created action types here: https://developers.facebook.com/apps/<app_id>/opengraph - once they have been approved you will be able to use them publicly.
You have to submit the actions also you need to take the permission from the user.
There are two types of permission, user permission and friends permission. Your suppose to take 'publish_actions' permissions from user as well as from friend.

Getting friends of friends in FB graph API

I would like to get friends of friends via an API call and when I try to do it, I get the following exception,
{
"error": {
"type": "OAuthException",
"message": "(#604) Can't lookup all friends of .... Can only lookup for the logged in user (...), or friends of the logged in user with the appropriate permission"
}
}
The URL I am trying to access is,
https://graph.facebook.com/friend_id/friends?access_token=access_token
I am getting extended permissions which is as follows,
<fb:login-button perms="user_likes,friends_likes"></fb:login-button>
Could any one please let me know what's going wrong here? Or does it mean I can never get access to friends of friends?
Currently, there is no extended permission that allows you to view a user's friends of friends. The "*_likes" permissions just show you the Facebook pages that the users have Liked.
It might be possible for you to iteratively fetch and cache the friends of each of the user's friends, one by one, but without access tokens for each friend, you'll only be able to fetch public data.
I got friends of friends(limited). I had same problem. Though it is very late for answering question, it will help somebody. That's why answering this question.
We can get friends of friends those are app users.
$fb_id= user id whose friends of friends required.
$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) )";
$user_info=$facebook->api(array('method'=>'fql.query',
'query'=>$query));
#Olie:
You are fetching your friends of your friend through application. So you would need permission from your friend whose friends you want. i.e. Your friend should be using that application and accepted those permission while allowing accessing information. Otherwise you wont be able to friends of your friend. I have tested this query. And it works successfully.
"message": "(#604) Can't lookup all friends of .... Can only lookup for the logged in user (...), or friends of the logged in user with the appropriate permission"
This message explains well. Read carefully.
Hope you understand solution criteria.
You cannot get friends of friends, it is not allowed due to privacy concerns.
A workaround we have done before is to save all users friends to oure own database.
That way we could cross-reference all the different users friend-list's and at least get friends of friends who have used the application we made.
Important note, such a table would quickly grow quite seizable depending on the amount of users you get.
Count on each user having about 250-300 friends on average, so if you opt for such a solution make sure to optimize your database for it, and then it should work just great.
Got same problem, had to use old REST API to get at least mutual friends, see
http://developers.facebook.com/docs/reference/rest/friends.getMutualFriends/
You can get the friends of the current user through a Graph API call to me/friends. You will need any valid access_token, no special extended permissions, just the Basic one. There is one caveat, that user must allow you to see their friend list. So in the Privacy Settings > Connecting on Facebook there is a "See your friend list" setting. If the user has chosen a custom setting and selected say "Only Me" you will get this error.
Similarly, if the current user allows others to see their friend list, but one of the friends shuts this down due to privacy concerns then you will not be able to see any data and will get that error.
I was able to verify the scenarios I have described.
Unfortunately, I can't ask your answer specifically since I don't have experience with the FB API. However, I believe that FB allows users to hide who their friends are. If they have this set, then perhaps you won't be able to access their friends at all. I'd try to modify your code to first check what the permissions of a given user are and only then accessing their friends list if you have access to it. A bit of speculation here, though.