I have a code that extracts all friends from facebook api, but I would like to get only facebook friends who use the application. I tried fb.request ("me / friends? Fields = installed"); but never worked, do i need extra permission?
Here is my code:
jsonUser = fb.request("me/friends"); friendObj = Util.parseJson(jsonUser); friendArray = friendObj.getJSONArray("data"); friendlist = new ArrayList<String[][]>(); String[][] friendsToList = new String[1][2]; int friendCount = 0; String fId, fNm; JSONObject friend; for (int i = 0;i<friendArray.length();i++){ //Get a JSONObject from the JSONArray friend = friendArray.getJSONObject(i); //Extract the strings from the JSONObject friendsToList[0][0] = friend.getString("id"); friendsToList[0][1] = friend.getString("name"); friendlist.add(friendsToList); //Set the values to our arrays Log.e("Tester",""+ friendsToList[0][0]+" "+ friendsToList[0][1]); friendCount ++; }
source share