Facebook graph api friend_list of two apps toguether - facebook-graph-api

I have two Android apps that use facebook friends of the user and their High Scores. (lite version(A) and pro version(B)).
The problem is that i need to import the user´s facebook friend list of players that use A and B version.
When i import the friend_list from (A) i just get the friends of the user that have (A) and it doesn´t take the friends of the user that play (B)
and the same in the opposite case.
Is there a way to sync (A) and (B) friend_list?

You mean to make a request to the api facebook two different users, asking your friends list? if so, something like you might be useful...
https://graph.facebook.com/v2.6/friends?ids={user-id-a},{user-id-b}&access_token=*
Check documentation: https://developers.facebook.com/docs/graph-api/using-graph-api/

Related

How can I filter taggable friends list and only retrieve the ones that are not already part of friends list using Facebook graph API

As you know, with Facebook Graph API v2.0 upgrade you no longer can retrieve all the friends using the "me/friends" endpoint. That endpoint will now return only those friends who are also registered for the same app (app-scoped users). To retrieve all the friends, Facebook provided a new API (taggable friends) at endpoint "me/taggable_friends".
The problem I am having is that taggable friends list is a super set of the friends list and there is no reliable way to exclude the latter from the former. Thus the users from the "me/friends" list will also appear under the users from "me/taggable_friends" list.
For example, let's say I have total of 2 different friends on Facebook and both of them are called "Joe Hammer". Let's further imagine that only one of them is also using the app that I am using. The app allows users to tag friends on Facebook. For this there is a drop-down that shows all the friends that a user can tag. Previously it would show both "Joe Hammers" in the list as "me/friends" API would return all the friends. Now there has to be two separate lists, one to show the friends that are already using the app ("me/friends" result, or app-scoped users), and a second list, to invite the ones who are not using the app yet ("me/taggable_friends" result). However, on the page the first list will correctly show only one user "Joe Hammer" that is registered with the app. But the second list will show both Joe Hammers, as technically they are both taggable. Since the result set returned from "me/taggable_friends" is using encrypted temporary user IDs there is no way for me to filter out the users from the taggable friends list who are already on the "registered" friends list. As you can imagine this makes the UI look a bit ugly with duplicate users showing up on both lists.
One may argue that this is not a common case and you can filter by a user name, as so far that is the only field that is common between the nodes of both lists. However, this scenario is not uncommon. I would say at least 5% of users would have two or more friends with the same name.
The only way i can think of (and i assume that was your intention too) is to read friends with /me/taggable_friends and /me/friends and compare them by name. Those who are not in the result of /me/friends don´t use the App, obviously.
But keep in mind that you are only supposed to use taggable_friends for tagging friends and nothing else. So it would actually not make much sense to filter them, the user should decide which friends he would like to tag, no matter if they are already using the App or not.

facebook opengraph, how to make customized queries?

I want to make a request to search for 'customized' things, like: Restaurants nearby (see screenshot here)..
Another example is: Music my friends like, in the Graph API explorer, if I query music, I just get what I like, not my friends'. Any tip? tks.
me/friends?fields=music
will give you the music interests of your friends
and for nearby restaurants you will have to execute a complex query like
search?q=cafe&type=place&center=37.76,-122.427&distance=1000
Refer to this page for search types

best way to send friend a card through FB app

I have an app that allows users to construct a personal card with a message, photo, song, etc. for an occasion (birthday being just one example). You can check it out here: apps.facebook.com/getmixxd
I was using graph api to allow the sender to post to recipient's wall with the option to make it public or private. As of Feb 5th this functionality is disabled apparently.
My question is what is my best alternative? Just using the dialog box doesn't seem to solve the problem because one of the features users asked for was ability to specify when the card was delivered (my friend's birthday is tomorrow, but I want to construct the card today and have it delivered tomorrow). Also, none of the preset custom actions appear to apply.
Looking for some advice from FB gurus on what my best option is...
Thanks!!
Mike
First, I'm not an FB Guru, and this is also problem of mine.
Here's what I've repeatedly seeing for the solution:
https://stackoverflow.com/a/15234553
Your best bet is the Open Graph API, which is you have to submit an Application for and "action" an a corresponding "object" for that. For example action "cook" and object "recipe".

How can I get "close friends" list of a Facebook user, using the Graph API?

The graph Api gives me the user's friends.
But I want to know who its close friends are (SmartLists).
How can I do that using the Graph API?
You can call /me/friendlists to get the friends list. One of them should be close friends. Then go to /closeFriendsListId/members to see who is on that list. You will need read_friendlists extended permissions.
I recently saw a simpler way. /me/friendlists/close_friends?fields=members will give you the list of all members at one shot. Just wanted to put it out here in case if somebody needs help.
Similarly, call to /me/friendlists/family?fields=members will give family members.
P.S: "close_friends" and "family" are keywords and no need for a ID.
This is no longer possible. Facebook removed the ability to see the members of a friend list somewhere before version 2.5 of their API.

how to the get the friend count of each one of a user's friend?

is there a way with the Graph API or even the old API to get the number of friends (not the list of names, just the count) of each friend of my user?
so if John is using my app and John has 3 friends, Stacy , Amy and Bill, I would like to know how many friends Stacy, Amy and Bill have..
I know you can't get the list of friends (only the ones in common), I just want the count.
I don't think the count is private. In fact, even for people who block their friend list, I get a count of how many friends they have on the original email I get when they friend me., right under their name.
Graph API and FQL don't provide this information. It is publicly available without being logged in on alot of users pages by going to https://www.facebook.com/profile.php?id=5 and then scraping it. Although its against the terms of service and isn't available for every user.
You can get this information from the Graph API by issuing a request to the /PROFILE_ID/friends endpoint. This will return a list of the user's friends as an array-- which you can count.