2016-05-18 2 views
-1

私たちはfb loginを通じて私たちのアプリを使っている友達を検索するためにfacebook sdk 3.23.0を実装しましたが、私のアプリを使用していてfacebookでログインしている友人たちが私たちが知らない私たちのコードやFacebookのアカウントの設定から何か技術的な不具合がありましたら、この問題の根本的な原因をお知らせください。友人を使っているすべてのアプリはfacebook sdkを使用していません3.23.0

次の友人のリストを取得するためのコード、我々のアプリ

Request request = Request.newMyFriendsRequest(session, 
        new Request.GraphUserListCallback() { 


         @Override 
         public void onCompleted(List<GraphUser> users, 
           com.facebook.Response response) { 
          // If the response is successful 
          Log.d(TAG, "users::********* " + users); 
          // Log.d(TAG, "users.size:: "+users.size()); 
          Log.i("INFO", response.toString()); 
          ArrayList<FbUser> fbUserList = new ArrayList<FbUser>(); 


         } 
        }); 
+1

Mを使用している人あなたはその文書を読むべきです。あなたは、アプリケーションにuser_friends権限を与えた友人のみを取得します。 – WizKid

+0

fbログインダイアログでuser_friends権限をリクエストする方法は? – shobhan

+0

fbログインのコードを入力してください – xAqweRx

答えて

1
**Try this maybe its help you change tag as your requierment ** 


new GraphRequest(
          AccessToken.getCurrentAccessToken(), 
          // "/me/friends", 
          //"me/taggable_friends", 
          "me/invitable_friends", 
          null, 
          HttpMethod.GET, 
          new GraphRequest.Callback() { 
           public void onCompleted(GraphResponse response) { 

            try { 
             JSONArray rawName = response.getJSONObject().getJSONArray("data"); 
             Log.e(TAG,"Json Array Length "+rawName.length()); 
             Log.e(TAG,"Json Array "+rawName.toString()); 


             for (int i = 0; i < rawName.length(); i++) { 
              JSONObject c = rawName.getJSONObject(i); 




              String name = c.getString("name"); 
              Log.e(TAG, "JSON NAME :"+name); 

              JSONObject phone = c.getJSONObject("picture"); 
              Log.e(TAG,""+phone.getString("data")); 

              JSONObject jsonObject = phone.getJSONObject("data"); 

              String url = jsonObject.getString("url").toString(); 
              Log.e(TAG,"@@@@"+jsonObject.getString("url").toString()); 


             } 



            } catch (JSONException e) { 
             e.printStackTrace(); 
            } 

           } 
          } 
        ).executeAsync(); 
+0

"/ me/friends"を変更しようとすると正しい結果が得られない場合は // "me/taggable_friends"、 "me/invitable_friends"、 –

+0

単にtaggable_friendsまたはinvitable_friendsに変更してください。それらのエンドポイントは、非常に特定のタスク(友人にタグを付け、キャンバスを持つゲームに友人を招待する)のためだけに存在します。 – luschn

+0

この権限をお持ちでない場合は、データを受信しません – xAqweRx

関連する問題