Facebook登录响应:未获取用户详细信息(ID和名称) [英] Facebook login responce : Not Get Users details except (Id and name)

查看:309
本文介绍了Facebook登录响应:未获取用户详细信息(ID和名称)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook登录响应不会获取用户的所有详细信息,如电子邮件,名字,姓氏。它的工作正常在Facebook Graph API v2.0,但不是在v2.4。我使用这个插件PhoneGap应用程序。此存储库位于 https://github.com/phonegap-build/FacebookConnect

Facebook login responce not getting user's all Details like email, firstname, lastname. Its works fine in Facebook Graph API v2.0 but not in v2.4. I am using this plugin for PhoneGap application. this repository from https://github.com/phonegap-build/FacebookConnect

if (response.authResponse) {
      facebookConnectPlugin.api('/me', null,
           function (me_response) {
               var username = me_response.email;
               var firstname = me_response.first_name;
               var lastname = me_response.last_name;
               var ExternalIdentifier = me_response.id;
               var Email = me_response.email;                           
               var ProviderSystemName = "ExternalAuth.Facebook";
               ExternalResponseInsert(apiSecretKey, storeId, languageId, username, firstname, lastname, Email, ExternalIdentifier, OAuthToken, OAuthAccessToken, ProviderSystemName);
                    facebookConnectPlugin.logout(function (response) {}, function (response) {});                            
               });
            } 


推荐答案

a href =http://stackoverflow.com/questions/31692355/facebook-only-returning-name-and-id-of-user/31692908#31692908> Stackoverflow问题

This is a reference from Stackoverflow Question

看起来您正在使用第2版的Graph API。请参阅

Looks like you're using v2.4 of the Graph API. See

  • https://developers.facebook.com/docs/apps/changelog#v2_4

声明性字段

要尝试提高移动网络的效果,第2.2版中的节点和边需要您明确请求您需要的字段。例如, GET / me 默认情况下不再包括喜欢和评论,但 GET / me?fields = id,name,username,emails,first_name ,last_name 将返回数据。有关详细信息,请参阅有关如何请求特定字段的文档。

Declarative Fields
To try to improve performance on mobile networks, Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example, GET /me no longer includes likes and comments by default, but GET /me?fields=id,name,username,emails,first_name,last_name will return the data. For more details see the docs on how to request specific fields.

这篇关于Facebook登录响应:未获取用户详细信息(ID和名称)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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