In my app, I have allowed users to signup through Facebook. When user logged in, I get access token. Now I want to get email address of the user. How to get that?
Asked
Active
Viewed 3,872 times
3
-
go through [this](http://stackoverflow.com/questions/5403417/fetch-facebook-user-data) link – Vamshi Jan 12 '12 at 11:26
1 Answers
9
First of all add permission
public static final String[] PERMISSIONS = new String[] {"email"};
String response=authenticatedFacebook.request("me");
JSONObject obj = Util.parseJson(response);
useremail=obj.getString("email");
where authenticatedFacebook is Facebook object.
Util will available along with Facebook SDK.
Ensure that you gave Email permission.

Venky
- 11,049
- 5
- 49
- 66
-
do i need a "built for mobile" facebook app to get user data from facebook(if he is logged in) or "built for web" is enough. because i already have a facebook web app, can i use that APP ID??? – Housefly Jun 05 '12 at 06:28
-
@Archie.bpgc I don't have idea about Web Application.. But i think we can use same App Id for both Web and Mobile – Venky Jun 05 '12 at 06:30
-
Util class is now deprecated. Better to `user.getInnerJSONObject().getString("email");` – nawfal Jan 22 '13 at 13:02