2015-12-16 68 views
-1

5個月前我做了一個應用程序。示例最新的android facebook sdk-4.8.2登錄並獲取用戶詳細信息

在這個應用程序中,我使用過Facebook的sdk API版本v2.3。一切都很好。但現在我已經改變了應用程序包名稱。所以我必須創建一個新的Facebook開發者帳戶。在這個帳戶中,API版本是v2.5,Facebook sdk版本是4.8.2。

因此,現在我無法再獲取用戶個人資料的詳細信息(如名字,姓氏,電子郵件,性別等)。任何人都可以請幫助我對sdk的新變化以及如何與新版本進行整合?

回答

3
Use this code for get details. 

Request.executeMeRequestAsync(Session.getActiveSession(), 
         new Request.GraphUserCallback() { 
          @Override 
          public void onCompleted(GraphUser user, 
            Response response) { 

           if (user != null) { 

            Bundle params = new Bundle(); 
            params.putString("fields", 
              "cover,first_name,gender,last_name,email"); 
            new Request(Session.getActiveSession(), 
              "me", params, HttpMethod.GET, 
              new Request.Callback() { 
               @Override 
               public void onCompleted(
                 Response response) {} 

               } 
              }).executeAsync(); 
相關問題