1

友達リストにないFacebookユーザーの名前、ID、性別、年齢、興味、誕生日を取得する必要があります。

現在、ユーザーの名前、ID、性別のみを取得しています。他のパラメーターにアクセスする方法を教えてもらえますか...??

私のコードは

Request req = new Request(session, facebookID, params, HttpMethod.GET, new Request.Callback() {

            @Override
            public void onCompleted(Response facebookUserResponse) {

                System.out.println("Facebook User Response is: "+ facebookUserResponse);

                GraphObject facebookUserResponseGraphObject = facebookUserResponse.getGraphObject();
                JSONObject facebookUserResponseJSONObject = facebookUserResponseGraphObject.getInnerJSONObject();


                String gender = null;
                String birthday = null;
                String timezone = null;
                String hometown = null;
                String location = null;
                String age_range_min = null;
                String age_range_max = null;


                try{
                    gender = facebookUserResponseJSONObject.getString("gender");
                } 
                catch (JSONException e) {
                    e.printStackTrace();
                    gender = null;
                }

                try{
                    birthday = facebookUserResponseJSONObject.getString("birthday");
                } 
                catch (JSONException e) {
                    e.printStackTrace();
                    birthday = null;
                }

                try{
                    timezone = facebookUserResponseJSONObject.getString("timezone");
                } 
                catch (JSONException e) {
                    e.printStackTrace();
                    timezone = null;
                }

                try{
                    hometown = facebookUserResponseJSONObject.getJSONObject("hometown").getString("name");
                } 
                catch (JSONException e) {
                    e.printStackTrace();
                    hometown = null;
                }

                try{
                    location = facebookUserResponseJSONObject.getJSONObject("location").getString("name");
                } 
                catch (JSONException e) {
                    e.printStackTrace();
                    location = null;
                }

                try{
                    age_range_min = facebookUserResponseJSONObject.getJSONObject("age_range").getString("min");
                } 
                catch (JSONException e) {
                    e.printStackTrace();
                    age_range_min = null;
                }

                try{
                    age_range_max = facebookUserResponseJSONObject.getJSONObject("age_range").getString("max");
                } 
                catch (JSONException e) {
                    e.printStackTrace();
                    age_range_max = null;
                }


        }
    });

        Request.executeBatchAsync(req);
4

1 に答える 1

0

このリンクを確認してください。https://developers.facebook.com/docs/reference/fql/user

ユーザー テーブルで使用可能なすべての列が一覧表示されます。

于 2013-10-25T09:37:41.767 に答える