# Problems getting email from facebook

**URL:** <https://forums.solar2d.com/t/problems-getting-email-from-facebook/327015>\
**Category:** Social Media\
**Created:** [July 14, 2014, 10:32am UTC](https://forums.solar2d.com/t/problems-getting-email-from-facebook/327015 "2014-07-14T10:32:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.hunt15](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@david.hunt15](https://forums.solar2d.com/u/david.hunt15)\
**Post date:** [July 14, 2014, 10:32am UTC](https://forums.solar2d.com/t/problems-getting-email-from-facebook/327015/1 "2014-07-14T10:32:10Z")

</div>

Hi,&nbsp;

I am trying to get the current users email address from facebook but I can’t seem to get it to work… &nbsp;I was able to get the profile pic, first name, last name, etc with no problems (using **facebook.request(“me”, “GET”)**)&nbsp;but email is being a pain…

I did some searching in these forums and found a comment by rob miracle in a post from jan 14 suggesting the code below is the way to do it (based off the facebook sample app). &nbsp;The comments after in the same post seemed to &nbsp;suggest that it worked for some users.

However, when I run the code I get this error:

FACEBOOK CALL FAILED The operation couldnt be completed. (com.facebook.sdk error 5)

I’m wondering if something has changed since rob’s post so I was hoping that somebody could maybe try this and see if it works for them (i.e. ive set something up wrong in the dev portal).&nbsp;

Or, is there another way I should be doing this?

Many Thanks

```
 local function facebookListener(event) if (event.type == "session") then if (event.phase == "login") then sessionToken = event.token local params = { fields = "name,username,first\_name,last\_name,picture,installed,email" } facebook.request( "me", "GET", params ) end elseif (event.type == "request") then local response = event.response native.showAlert("My Response", response) end end facebook.login( fbAppID, facebookListener, {"publish\_actions, email"})

```

&nbsp;In facebook dev potal I have &nbsp;the following and im using my own facebook login that created the app

&nbsp;  
email

Provides access to the person’s primary email address. This permission is approved by default.

&nbsp;  
public\_profile

Provides access to a person’s basic information, including first name, last name, profile picture, gender and age range. This permission is approved by default.

&nbsp;  
user\_friends

Provides access to a person’s list of friends that also use your app. This permission is approved by default.
