Facebook profile id和uid有区别吗? [英] Is there a difference between Facebook profile id and uid?

查看:830
本文介绍了Facebook profile id和uid有区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,我通过这个代码段获取了Facebook的应用程序用户:

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;

应用程序有一个错误, uid没有被存储在数据库中,我需要从我们的facebook个人资料网址(我有这个)开始检索它们。

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).

正如这里我试图使用图形数据获取他们的ID,但是这个配置文件ID与uid不同。

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

我尝试过我的个人资料,我收到两个不同的ID,一个来自图表(较短的10位数字),一个来自应用程序,大约15位数字)

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)

我仔细检查了你的u id我从应用程序作为一个参数在URL中,以这种方式:facebook.com?profile?uid=XXXXXXXXXX,但我没有得到我的个人资料。

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.

那么,uid和profile id是不同的东西吗?如何获得UID,同时拥有个人资料ID和个人资料URL?

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

推荐答案

自2014年4月30日新的Facebook应用程式使用版本2.0的Facebook图形API。其意义在于您在应用程序中返回的用户ID是应用范围。应用范围意味着这确实是您的规范/全局ID的不同ID。您的应用程序将始终为给定的用户看到相同的ID,但不同的应用程序将为同一用户显示不同的ID。

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.

我恐怕没有办法从应用范围的ID(您看到的更长的ID)转到用户的个人资料。这背后的想法是保护人们的隐私。还没有办法从配置文件URL转到应用范围的ID。

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

这篇关于Facebook profile id和uid有区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆