我正在尝试获得新用户的Facebook好友(向他们推荐朋友(。我做了所有的工作:在应用程序中集成Facebook,许可Facebook等。
然后我用它来获取用户
curl -i -X GET
"https://graph.facebook.com/v4.0/ i put the user id here }?fields=id%2Cfriends&access_token= my acces token"
它有效,但 id 有问题:
如果我使用脸书图形API:它说我的ID是:23337 ...(仅限数字(。
如果我在颤振应用程序中使用脸书登录:我的 ID 是:M670V ...(数字 + (大写
( 字母 ( 只有只有数字的 id 才适用于卷曲。 我怎样才能获得只有颤动脸书唱歌的数字的 id?
谢谢!
在使用Firebase身份验证登录Facebook时,uid是Firebase ID,因此如果您需要facebook userId,请调用一个api进行get。
var graphResponse = await http.get(
'https://graph.facebook.com/v2.12/me?
fields=name,first_name,last_name,email&access_token=${facebookLoginResult
.accessToken.token}');
var profile = json.decode(graphResponse.body);
print(profile.toString());
//it return detail of facebook user
https://developers.facebook.com/docs/graph-api/using-graph-api/
经过一番研究,
带有数字+字母的ID是Firebase ID,它与真正的Facebook ID不同。
感谢您的帮助!