How can I get user's best friends throught Facebook Graph API - facebook

I am designing an App for iPhone and I want the user to share my App to his or her best friends. Now I can get user's friendlist throught Facebook Graph API. But how could I find user's best friends? I have an idea that I can use the user's wall to find which friend often appears on the wall. However, some pages and famous people like Obama always appears on the wall. Could someone give a feasible solution?

Define “best friends”, please.
If that is supposed to be something based on the user’s personal perspective at the very moment – then probably best to just let them choose their “best friends” the want to a request to themselves via a simple multi-friend selector.
Or are you referring to a user’s list of “close friends”, the default friend list on Facebook that every user can add friends to? That’s available via API, check the /me/friendlists connection. https://developers.facebook.com/docs/reference/api/FriendList/

Related

Facebook API - Friend List

I searched the internet the whole day for this, and came to the conclusion that there is no way to get a user's full friend list since API 2.0 (correct me if I am wrong).
What I want to do is, given the app user and another facebook user, generate a report about their "second level" mutual friends. That is - (friends of mine) who are friends with (a friend of his). Illustration:
Is this kind of thing possible after facebook's restriction since API 2.0 in any platform (Different SDKs, Facebook's Graph API, etc)?
Many Thanks.
This would be the API: https://developers.facebook.com/docs/graph-api/reference/user-context/all_mutual_friends
There is no way to get friends (or users in general) who did not authorize your App. Every list you get will only include users who authorized your App.

Facebook contest / promotion app force user to share post

I'm developing a Page Tab App for a contest/promotion and my client wants participants to share a certain post on their own wall to be eligible for winning. I have a few questions about this:
Is that even legal, under Facebook's promotions guidelines? Note that we don't want the user to share to be able to participate, but to be eligible for winning.
How would we go around the privacy issue for each user? I mean, can we force a user to share a post publicly, even if the normal setting is - for instance - "friends only"?
Still on privacy: can I even access who shared a certain post by using the Graph API, or get a callback response from Facebook when the user shares a post? I don't think so - the only way I see it is that the contest administrators would have to check every user's wall to see if he/she shared the post publicly. Is that how it's normally done?
I know some of these questions are duplicated but couldn't find a proper answer, so I'm asking them together here.

Allow user to post to friends wall as user (not as app)

Is there a way (perhaps through a rest api or graph api) to allow a user of my application to write on a friends wall without the usual 'on behalf of' or posted by my application? I know many people will not authorize an application that can post on your behalf, but I'd still like my users to be able to easily write on friends walls (without leaving the game page). I'm fine with it not promoting my game in any way - it should look just like it would if done through Facebook's site. I know there is something like this for Google+ using their mobile restful interface. Is this possible for Facebook and if so, how?
No, I don’t think there is a way of doing that. If a user uses an app to create content, then it will show that he used this app.

Get id's of people that are using your facebook app at this moment

How can I get a list of all the people that are using my Facebook app at this moment?
Is that even possible?
I need it in order to compare with user's friends, so the users would know if one of their friends playing the game right now...
You would need to store and surface this information in your own system. There is no Facebook API or method that returns this information.

Get a list of my friend's friends

I am building a small facebook app. In my app I am trying to get a list of my friend's friends. When I perfrom this I receive an error from facebook that I cannot select information about people that are not me (I was trying to retrieve my friend's friends )
Here is an example of what I mean:
User A - Uses the application
User B - Friend of user A and also uses the application
I want User A to be able to see a list of all of user's B friend's who are using the application as well.
Is there any way to get arround that? How can I do this?
The way to get a list of friends for someone is by using the friends.get API method. However, webdreamer is correct in that you can't just pick any Facebook ID you want and start pulling out friend information for that person. The person you query about has to have authorized your application... otherwise any app developer could find out anything about anyone on Facebook, which would be a privacy nightmare.
It's tough to tell exactly what you want to do though, as your comments say you just want the friends of a user, and your original question says you want the friends of the friends. The first is possible... the second is not.
For the first, all you need to do is have someone add/authorize your app. After that, friends.get will work fine with that user's session key, which will be provided to your application, and you can get a list of their friends.