use of io.openkit.facebookutils.FacebookUtilities.GetFBFriendsRequestHandler in project openkit-android by OpenKit.
the class OKSocialLeaderboardFragment method getSocialScoresFromOpenKit.
private void getSocialScoresFromOpenKit() {
if (FacebookUtilities.isFBSessionOpen()) {
startedSocialRequest();
FacebookUtilities.GetFBFriends(new GetFBFriendsRequestHandler() {
@Override
public void onSuccess(ArrayList<Long> friendsArray) {
currentLeaderboard.getFacebookFriendsScoresWithFacebookFriends(friendsArray, new OKScoresResponseHandler() {
@Override
public void onSuccess(List<OKScore> scoresList) {
OKLog.v("Got %d social scores!", scoresList.size());
addScoresToSocialScoresListAdapater(scoresList);
stoppedSocialRequest();
}
@Override
public void onFailure(Throwable e, JSONObject errorResponse) {
OKLog.v("Failed to get social scores from OpenKit: " + e);
stoppedSocialRequest();
}
});
}
@Override
public void onFail(FacebookRequestError error) {
OKLog.v("Failed to get Facebook friends");
stoppedSocialRequest();
}
});
}
}
Aggregations