7

The current code I am working on, for some reason, when I do

https://graph.facebook.com/me?access_token=access_token  (accesstoken from callback response)

It is returning id: some number which is not my real facebook user id. It also gives link as:

https://www.facebook.com/app_scoped_user_id/<number>

If I use the access token from the access token tool from facebook, it is returning my actual user id.

Also, I remember, old apps I worked on, they return only actual userid, not getting whats happening here.

Regarding friends:

With access token from access token tool, I am getting full friends list. But with the token from the app, I am getting only one friend(I added recently). Not getting what happened.

user2349115
  • 1,288
  • 2
  • 17
  • 34
  • This is effectively the same problem as http://stackoverflow.com/questions/23417356 In particular, this might mean the problem might not be soluble; from the answer to that question: "In v2.0 of the Graph API, calling `/me/friends` returns the person's friends who also use the app … In other cases, apps are no longer able to retrieve the full list of a user's friends (only those friends who have specifically authorized your app using the `user_friends` permission). [This has been confirmed by Facebook as 'by design'](https://developers.facebook.com/bugs/1502515636638396/)." – Owen Blacker Jun 04 '14 at 15:54

3 Answers3

13

I've tested quite extensively for what's accessible and not since I realized the changes last night. Even if you get your user's friends, you will NOT be able to retrieve user's friend's useful info anymore. You will not be able to access friend's albums and photos so getting access to the taggable friends is of no use for sure because your App can no longer "Act like the user" anymore. You should also notice some of the FQL tables is gone with v2.0, namely, location_posts (and I bet checkins as well). Some fields are also "nulled" out such as mutual_friends_count. You will need to test everything just to be sure what's been changed as many of the differences are not documented.

If you already has apps running on v1.0, beaware that v1.0 will be deprecated entirely in April 2015.

While I understand FB want to take away the whole impersonation for securing users privacy, it chooses to achieve this by entirely shutting down the reason that many App developers choose to integrate with Facebook - because they can leverage facebook's data in their apps that users would be interested in. To third party Apps, it's no more than just a free OAuth service to me because the social aspect is essentially all gone now as far as I can tell.

I would appreciate knowledgeable parties to shade some light on what's still "social" about FB integration now that with v2.0? I'm at my early stage of development and now I think I will probably ditch FB entirely but just in case there are something out there that I'm not aware of.

JChow
  • 268
  • 1
  • 11
  • 2
    In my opinion, nothing. Now you are limited to a person only, you can fetch only an user's data, nothing else, no social things. – seoul May 06 '14 at 10:22
  • 1
    it is sad. The open app and open data platform is what makes FB different from other social networks and crushed oldies like friendster and myspace. Now it's going backward when number are going all over the places stating that FB is losing traction on new signup from teens. – JChow May 07 '14 at 07:43
7

Fosco and CBroe are correct. You can only get the friends who have already used the app. It is mentioned in the Facebook upgrading doc from v1.0 to v2.0 of the Graph API. It happened on April 30th.

/me/friends returns the user's friends who are also using your app

In v2.0, the friends API endpoint returns the list of a person's friends who are also using your app. In v1.0, the response included all of a person's friends.

There are two key use cases where apps need access to non-app friends: tagging and inviting. In v2.0, we've added the Taggable Friends API and the Invitable Friends API to support these flows.

After a person has logged in with v2.0 of Facebook Login, calling /v1.0/me/friends and/v2.0/me/friends` will both result in the v2.0 behaviour - both calls will return the set of the person's friends who also use the app.

So, this means that if you need the full list, you're only left with the Taggable and Invitable APIs. Unfortunately, Invitable is only for FB Canvas games, and Taggable needs reviewing by FB before you can even test it, something that can take 1-2 weeks, and you need to provide info about your app and justification over why you need such features. Even if you manage to get access to the Taggable API, you can only get the name and pic of the user.

FB destroyed everything. Developers (like me) that were relying on such key features are ruined. Maybe (yet another) sign that nobody should rely on FB? I would like to hear some thoughts on this.

Community
  • 1
  • 1
Kostis
  • 1,593
  • 15
  • 16
  • What do you think of as a valid use case, which cannot be accomplished with the `taggable` and/or `invitable` API's? – Sean Kinsey May 04 '14 at 04:50
  • 1
    Definitely agree that Facebook just took a major turn in the wrong direction for app developers. Now only super popular apps can get any use out of the friend lookup feature; and these apps probably don't even need Facebook. It's strange because they just introduced the capability of letting users choose which permissions they are willing to accept; and the headline screenshot shows the user denying friend access. But it won't even work if the user grants permission. They went from everything to nothing without even hitting the reasonable middle ground of letting the user choose. – Daniel May 04 '14 at 06:07
6

As of 4/30/2014, apps can only get the list of friends also using the app, and you have to request the user_friends permission. Also, users who have never logged in to your app before 4/30/2014 will get an app_scoped_id instead of their real facebook id.

Fosco
  • 38,138
  • 7
  • 87
  • 101
  • 1
    Yeah, I had set scope 'user_friends' permission. But, still getting only one person in friends list(added him in the last 2 days) – user2349115 May 03 '14 at 21:45
  • 1
    With Graph API v2 you will get _only_ the friends of the user that are using your app as well. – CBroe May 03 '14 at 22:02
  • What exactly can you do with the link that is returned that is formatted like https://www.facebook.com/app_scoped_user_id ? Any time I've tried to access that link it gets a not found error. – mikec May 14 '14 at 14:58