Facebook login responce : Not Get Users details except (Id and name)

僤鯓⒐⒋嵵緔 提交于 2019-12-12 02:50:16

问题


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) {});                            
               });
            } 

回答1:


This is a reference from Stackoverflow Question

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

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

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.



来源:https://stackoverflow.com/questions/31938903/facebook-login-responce-not-get-users-details-except-id-and-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!