Facebook Friends
Configure
This feature requires Facebook Authorization
Usage
To get friends list from Facebook social network you should implement onGetSocialFriendsResult method in Platform101XPListener:
@Override
public void onGetSocialFriendsResult(List<Platform101XPSocialFriend> friendsList, Platform101XPError error) {
if (error != null) { // Error
showMessage(error.toString());
} else { // Success
if (friendsList.isEmpty()) {
showMessage("Friends not found!");
} else {
//Handle friends list result:
StringBuilder friendsNameBuilder = new StringBuilder();
for (Platform101XPSocialFriend friend : friendsList) {
friendsNameBuilder.append(friendsNameBuilder.length() == 0 ? "" : ", ");
friendsNameBuilder.append(friend.getName());
}
showMessage("Friends: " + friendsNameBuilder.toString());
}
}
}
Platform101XPSocialFriend has getters:
getName() - the friend name
getSocialNetId() - the social network id
getPictureUrl() - the social network picture url
getMobileId() - the 101XP mobile ID
getLevel() - the player game level
To get social friend result you should call method Platform101XP.getSocialFriends() with type Facebook parameter:
Platform101XP.getSocialFriends(Platform101XPSNManager.Type.FACEBOOK);