Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a difference between Facebook profile id and uid?

I have an app and I'm getting Facebook uid of app users with this snippet:

    FB.login(function(response) {
        if (response.authResponse) {
            FB.getLoginStatus(function(response) {
              if (response.status === 'connected') {

                var uid = response.authResponse.userID;

There's a bug in the app and some of the uid have not been stored on the database. I need to retrieve them starting from the facebook profile url (I have that).

As explained here I tried to get their ID using the graph data, but this profile ID is different from the uid.

I tried with my profile and I get two different IDs, one from the graph (shorter, 10 digits) and one from the app (longer, around 15 digits)

I double checked putting the uid I get from the app as a parameter in a URL, in this way: facebook.com?profile?uid=XXXXXXXXXX but I don't get my profile.

So, are uids and profile ids different things? How can I get the uid, having both the profile id and the profile URL?

like image 317
user3692012 Avatar asked May 30 '14 16:05

user3692012


1 Answers

Since April the 30th 2014 new Facebook apps use version 2.0 of the Facebook graph API. The significance of this is that the user ID you see returned in your app is "app-scoped". App-scoped means that this is indeed a different ID to your "canonical"/global ID. Your app will always see the same ID for a given user, but a different app will see a different ID for the same user.

I'm afraid there's no way to go from an app-scoped ID (the longer ID you are seeing) to a user's profile. The idea behind this is to protect people's privacy. There's also no way to go from a profile URL to an app-scoped ID.

https://developers.facebook.com/docs/games/migrate#appscope

like image 128
Andy Borrell Avatar answered Nov 15 '22 05:11

Andy Borrell