Khawar Raza
Khawar Raza

Reputation: 16120

Android Facebook get email address of logged in through access token

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?

Upvotes: 3

Views: 3873

Answers (1)

Venky
Venky

Reputation: 11107

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.

Upvotes: 9

Related Questions