Facebook mutual_friend_count wrong? - facebook

I would like to know if anyone else has experienced this problem...
Facebook's count of mutual friends is off by 1. One too much. But not for all friends. I've tested this through my app where the fetched mutual_friend_count does not correspond to the number of mutual friends in the fetched array.
Further I have been checking this manually. By going to a FB-profile and literally counted our mutual friends. This also shows that we have one less mutual friend than the number Facebook is displaying in the "Mutual Friends" section on a friend's profile.
This does not apply for all my contacts on Facebook. Some profiles are displaying the number of mutual friends corresponding to the actual number of mutual friends.
But this do posses a problem if you are building an application/wesite/facebook app etc. that somewhat relies on the mutual_friend_count.
Can anyone confirm this? Is this a bug?
Or is it some kind of setting that some users can avoid being shown in the mutual friend section, but is still counted...?

I've been doing some work with mutual_friendsand I figured I'd give my 2-cents on what I've learned on this issue, which may or may not correspond to whats not working on yours.
Documentation for mutual_friends via Facebook Graph API is here
From the docs:
The user in the request and the session user must both have granted user_friends permission to the app.
This is a common mistake I was making. Even if you have mutual friends between users, if the friend has not given permission to the app, then you can't get their picture/name or any info on them, they simply appear in the total_count parameter.
If you want to call this endpoint on behalf two app-users who are not friends, then you must provide the appsecret_proof parameter along with the user access token when making the request. This means you must call this endpoint from your server.
This is also very important. If the two users aren't friends, then this endpoint will silently fail you providing NOTHING even though they have mutual friends. In order to actually get the data for this scenario, you need to be calling the endpoint from your server, not your client. That means not your javascript webapp, not your android app and not your iOS app.
There are some additional edge cases, such as users not providing the mutual_friends permission to your app, among other issues but at least for me these were the main issues I ran into. I never had any off-by-one errors, so I can't confirm your bug.

I can confirm that the mutual friend count is reduced by 1 sometimes. I counted a few, and some are right, and others are 1 less then it should be. It could be a setting in the privacy tab, I'm sorry I'm not much help.

Related

Get Mutual_Likes from Facebook Graph API

I am trying to get the mutual likes using the facebook graph API. But I'm having difficulties, I'm testing using the Explorer Application (https://developers.facebook.com/tools/explorer)
Using the following request:
ID?fields=context{mutual_likes}
But if I use my application it returns only the count as
"total_count": 0
But I know there are mutual likes. In fact, if I use the Graph API Explorer Application, (changing the ID) it works and brings the mutual likes.
Both users I'm testing with are friends in facebook and have their likes public. My app has recently been approved to use the user_likes permission. And maybe I'm missing something, I was hoping you could help me achieve this.
I finally figured out why the request returned only the count as 0. It had nothing to do with making the request server-side.
I managed to get the mutual_likes by having the users also approve the user_friends permission. Even though I wasn't going to use it in the GET request.
Apparently you need both permissions (user_likes & user_friends) if you plan to extract anything from the context fields of a user.
Hope it helps someone else.

Get list of events user is attending on Facebook

I'm trying to get list of events my friend / user attends. This info is publicly visible through Facebook pages.
I'm making a request to /userid/events but it returns empty array of results, though user does have upcoming events and calling /me/events is working. (all is ran in graph explorer)
I couldn't find any documentation about any limitations or required permissions to explain why it's not working e.g. this link
Is it a bug? How to workaround it?
You can use /userid/events with a user who auzhorized your App, but using /me/events is recommended. Either way, just because stuff is public on facebook.com does not mean you can get it with the API. You always need to authorize users before you can get any data, for privacy reasons.
In other words: It´s not a bug, there is no workaround, it´s not possible without user authorization.

Facebook Graph API - see which of a user's friends of friends also have my app installed

Would it be possible to have an app that returns the friends of friends of the current user that have the app installed? I understand that this may be impossible due to privacy issues, but is there not some sort of requirement that can be imposed when the app is installed to make this information public to everyone and so to the current user?
EDIT:
In fact, users will be entered into my own database so what I really need to be able to do is search through all of a user's friends and for each one query whether they have any friends who match a name/id in my database.
Nope, apps can only access information for friends of the current user, but not for friends of those friends again.
Otherwise, the “operating distance” of an app could be quite huge, without people even knowing what way an app was able to get access to their information (or that it even did get access at all) – look at it this way:
If you do not want to generally disallow apps to access some of your info when friends are using them, because it has some (social) benefits from your standpoint, but you have this weird guy/girl amongst your friends, who’s using sh*tloads of apps and giving them friends-permissions all the time … well, no problem, unfriend him/her, and all’s well. But now let’s say, that guy/girl/dude/whatever is not directly friends with you, but only with your younger brother (who you’re FB friends with in this scenario, of course) – you’d have to actually unfriend your brother for this to stop … and, not knowing your little brother (or whether you even have one) – I’d still guess this would not be what most Facebook users would want.

Distinguish facebook users without asking for permission

Within a facebook app, is there a reliable way ensure, that a given action can only be performed once per facebook user, without asking the user to authorize the app?
From the looks of the documentation and the lack of positive responses to this question I would deduce it's impossible, but I have been told the adverse - without actual details.
So what I need to know:
Is there any way to achieve this?
or (if not):
Is there any resource that clearly states that this is impossible?
Can you give a more detailed example of what you are trying to do and which language you are trying to do it in?
If you have the ability to access the user_id through an indexable field like you have in a friend, like or event relationship, you could just store the user_ids in your own database as they take actions in your page. If they've already performed the action once, you'd just give a message to the user and drop whatever action just occurred. You can find all the indexable fields in the fql documentation.
If you want to get the id from a random user who happens across your app, they need to authorize your app before you can get access to their information.
I've seen a few scam apps on FB that manage to get user permissions as soon as a logged in user visits their page. These violate the TOS and most likely get deleted and their admin banned as soon as they are reported.

Facebook Graph API Returns Inconsistent Number of Friends With Facebook Profile

I've noticed that using the new Facebook Graph API to fetch friends of users returns a number of friends that is close to, but not always exactly, the number of friends displayed on the user's profile.
Documentation here: http://developers.facebook.com/docs/api
For example, on that page, I click on https://graph.facebook.com/me/friends, and see the JSON for 477 friends, whereas my profile page on facebook shows a count of 478.
Does anyone know why there is an inconsistency?
If you have friends that have opted out of the Facebook Platform, they will not show up in the API response.
After being frustrated by inconsistent friend count, I asked a former Facebook engineer about it. It's a known bug related to their usage of memcached, and is considered too expensive, difficult, or otherwise not worthwhile to fix for now.
My two penneth: I've noticed that the number of friends which is displayed in my profile fluctuates (by 1)! I don't know what the reason for this inconsistency is but I suggest you keep checking that number in your profile regularly and see whether it's the case for you as well.
In terms of the Graph API the discrepancy between the friend count in my profile and in the data returned by the API is 2.