在Javascript中从uid获取Facebook third_party_id [英] Get Facebook third_party_id from uid in Javascript

查看:207
本文介绍了在Javascript中从uid获取Facebook third_party_id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图寻找它,但没有成功。



请问。

解决方案

third_party_id 图API中的用户对象中的一个字段,但它不是默认字段 - 它只会如果您特别要求,可以退回,例如

  GET https://graph.facebook.com/me?fields=third_party_id& access_token = [您的访问权限] 

将返回:



pre> {
third_party_id:[第三方身份],
id:[USER ID],
键入:user
}

在javascript中,最有可能要调用

  FB.api(/ me?fields = third_party_id,function(userData){
alert ThirdPartyId是:+ userData [third_party_id]);
});


Does anyone how to get the third_party_id from 'uid' in Javascript?

I'm trying to look for it but no success.

Regards.

解决方案

third_party_id is a field on the User object in the Graph API but it's not a default field - it will only be returned if you specifically request it, e.g.

GET https://graph.facebook.com/me?fields=third_party_id&access_token=[YOUR ACCESS TOKEN]

will return:

{
  "third_party_id": "[THIRD PARTY ID]", 
  "id": "[USER ID]", 
  "type": "user"
}

In javascript, you most likely want to call

FB.api("/me?fields=third_party_id", function (userData) { 
    alert("Your Facebook ThirdPartyId is: " + userData["third_party_id"]);
});

这篇关于在Javascript中从uid获取Facebook third_party_id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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