And I also want picture url, so I include "picture" in fields list:
Facebook facebook = new FacebookTemplate(accessToken);
String[] fields = {"id", "email", "name", "picture"};
User user = facebook.fetchObject("me", User.class, fields);
/*
"picture": {
"data": {
"url": "https://scontent...."
}
}
*/
if (user.getExtraData().containsKey("picture")) {
try {
LinkedHashMap<String, LinkedHashMap<String, String>> a = (LinkedHashMap<String, LinkedHashMap<String, String>>) user.getExtraData().get("picture");
LinkedHashMap<String, String> d = a.get("data");
String pictureUrl = d.get("url");
}
catch (Exception ex) {
}
}
The picture url is put in "extraData".
Không có nhận xét nào:
Đăng nhận xét