I had implemented spring controller for fetching all the information about my friend list. The implementation are as follows:
@RequestMapping(value = "/getFbContactList/{accessToken}", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
public String fbContactList(@PathVariable String accessToken) {
//accessToken recieved from facebook after OAuth authorization
Facebook facebook = new FacebookTemplate(accessToken);
System.out.println("User's FaceBook Profile Id::"+facebook.userOperations().getUserProfile().getId());
System.out.println("User's FaceBook UserName::"+facebook.userOperations().getUserProfile().getName());
System.out.println("User's FaceBook UserEmail::"+facebook.userOperations().getUserProfile().getEmail());
List<User> friends = facebook.friendOperations().getFriendProfiles();
for(User user : friends) {
System.out.println("User Email::" + user.getEmail());
}
return friends.toString();
}
The problem is that i am able to fetch my own information like Profile Id, User Name, Email,DOB but when i am printing the information about my friend's list it is not showing anything. It is having NULL values.
Can anyone give me some pointers where i am missing something.