I am creating an app with facebook login, and I am now able to successfully log in the user to facebook via the facebook api!
However, I am also trying to gather some information on the user, namely the number of existing friends that they have.
Note that I am NOT looking for the full list of friends (I don't know if there is an odd permission thing there or not) BUT instead I am looking only for the number of friends that the user has.
I have coded the below, but I cannot verify if it works or not because I cannot actually access the variable that I create in the request call outside of the request call. I'm guessing that there is probably a simpler (and more accurate) way to accomplish obtaining the number of friends that the user has...
Any ideas on how to accomplish this?
new Request(
Session.getActiveSession(),
"/me/friends",
null,
HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
// handle the result
final int iFacebookFollowerCount = (Integer) response.getGraphObject().getProperty("total_count");
}
}
);