Facebook登录的问题无法得到用户的实际Facebook的帐号 [英] Facebook login issue unable to get user's actual facebook id

查看:375
本文介绍了Facebook登录的问题无法得到用户的实际Facebook的帐号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在Android的,IOS和网络提供的应用程序。该应用程序使用Facebook的登录信息(使用 easyfacebook.jar )为授权用户的另一种方法。它工作正常,但由于最近的变化,Facebook的SDK,我无法得到实际的Facebook ID为Facebook的API返回的应用程序特定的用户ID。从的Facebook 页:

We have an app available in android, ios and web. The app uses facebook login(using easyfacebook.jar) as alternate way of authorizing users. It was working fine but due to recent changes in facebook sdk I am unable to get the actual facebook id as the facebook api returns app-specific user id. From the facebook page:

从1.0更改为2.0

Changes from v1.0 to v2.0

应用范围的用户ID:为了更好地保障人民群众的信息,当   人登录到版本您的应用程序已升级使用   图形API 2.0版,Facebook目前将发布一个应用程序范围的ID,而不是   该人的原单编号。但是,对于用户有previously   登录到您的应用程序,用户ID不会发生改变。

App-scoped User IDs: To better protect people's information, when people log into a version of your app that has been upgraded to use Graph API v2.0, Facebook will now issue an app-scoped ID rather than that person's orginal ID. However, for users that have previously logged into your app, the user ID will not change.

这是我得到的ID是为iOS,网页和android不同。请看看:

The id that I am getting are different for ios, web and android. Please take a look:

IOS和网络 https://www.facebook.com/559709594 //返回的实际用户ID

ios and web https://www.facebook.com/559709594 //return's actual userID

机器人 https://www.facebook.com/10152580446094595 / /不返回实际的用户id

Android https://www.facebook.com/10152580446094595 //not returning actual userId

我尝试了Facebook官方SDK来获得实际的用户ID,但没有成功。我想用下面的方式来获得用户的ID:

I tried the official facebook sdk to get the actual user id but it was not successful. I am trying to get user id using the following way:

user = graphApi.getMyAccountInfo();
            facebookIdLogin = user.getId();
            //returns app specific id not actual user id id = 10152580446094595 
            Log.d("username is : ", user.getName());//return actual value
            Log.d("facebook id is this", facebookIdLogin);
            Log.d("facebook user link", user.getLink());
            //returns www.facebook.com/10152580446094595 

有没有办法让我得到实际的用户ID。我需要因为平台之间同步的实际用户标识。无论我做什么,我只得到了应用程序特定的用户ID。下面是我要求的权限:

Is there any way for me to get the actual userId. I need the actual userId because of synchronization between the platforms. Whatever I do I am only getting the app specific userId. Here's the permission I am requesting:

String permissions[] = { "public_profile", "user_friends", "email" };

任何帮助是非常AP preciated。

Any help is highly appreciated.

推荐答案

一个应用程序范围的USER_ID被介绍与图形API 2.0版,全球USER_ID之间的区别是什么,你所看到的是。

What you're seeing is the difference between an app-scoped user_id which was introduced with the Graph API v2.0, and the global user_id.

看一看 https://developers.facebook.com/docs/apps/升级#upgrading_v2_0_user_ids 了解详情。

这篇关于Facebook登录的问题无法得到用户的实际Facebook的帐号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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