-1

In my application I need to get facebook friends. I wrote code for that but the result coming like this,

response:{"data":[]}

my code is:

    public void getFriendsInformation() {
            mAsyncRunner.request("/me/friends", new RequestListener() {
                public void onComplete(String response, Object state) {
                    String json = response;
                    try {
                        // Facebook Profile JSON data
                        JSONObject profile = new JSONObject(json);
                        Log.v("TAG_KK",""+profile);
  //result is {"data":[]}



                        runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                //new BackGroundTask2().execute();
                            }
                        });
                    } catch (JSONException e) {
                        // e.printStackTrace();
                    }


                }

                @Override
                public void onIOException(IOException e, Object state) {
                }

                @Override
                public void onFileNotFoundException(FileNotFoundException e,
                                                    Object state) {
                }

                @Override
                public void onMalformedURLException(MalformedURLException e,
                                                    Object state) {
                }

                @Override
                public void onFacebookError(FacebookError e, Object state) {
                }
            });
        }

How can I get friends from facebook.

Anthon
  • 69,918
  • 32
  • 186
  • 246

1 Answers1

1

Call this url to get friendlist

https://graph.facebook.com/me/friends?access_token="your accesstoken";

Dhaiyur
  • 98
  • 9