开发者

getting basic information from facebook access token in android

开发者 https://www.devze.com 2023-04-12 22:44 出处:网络
How to get the basic information like first name, last name, user id from facebook access token in android. I am able to login and 开发者_JAVA技巧get the access token but next problem is to get the ba

How to get the basic information like first name, last name, user id from facebook access token in android. I am able to login and 开发者_JAVA技巧get the access token but next problem is to get the basic information of the user.


Check this Code for Getting User Information ;

Bundle params1 = new Bundle();
params1.putString("fields","picture");
Log.v("sss", authenticatedFacebook.request("me"));
JSONObject jObject = new JSONObject(authenticatedFacebook.request("me"));
String id=jObject.getString("id");
String name=jObject.getString("name");
String email=jObject.getString("email");
try {
   URL img_value = new URL("http://graph.facebook.com/"+id+"/picture?type=large");
} catch (MalformedURLException e) {}
try {
  Bitmap mIcon1 =     BitmapFactory.decodeStream(img_value.openConnection().getInputStream());
} catch (IOException e) {}  

Code for getting id , name , email of Logged user in Facebook and also image of the logged user.

If you need further help in Facebook check this links

Graph Api in Facebook

Facebook Birthday Details of friends

Ensure you added required Permission in this Permissions

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号