0

I've upgraded an iOS app from using v2.3 to using v2.7 but no matter what I try FBSDKGraphRequest won't return email address compared to the Android counterpart (it's authorized)

My login button

self.hiddenButton.readPermissions = @[@"email"];

Here's my request code

[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:@{@"fields": @"id, name, link, first_name, last_name, email"}]
         startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result2, NSError *error) {

here is what it returns

{
    "first_name" = James;
    id = ********************;
    "last_name" = Mahy;
    link = "https://www.facebook.com/app_scoped_user_id/**************/";
    name = "James Mahy";    
}

and these are the permissions the login says I have access to

(
    email,
    "contact_email",
    "public_profile"
)

I have tried the answer from https://stackoverflow.com/a/31503463/555148 it doesn't change anything, I have tried recreating the app and still get the same problem.

I've also tried the same request on https://developers.facebook.com/tools/explorer?method=GET&path=me%3Ffields%3Did%2Cname%2Cemail&version=v2.7 with multiple Facebook users and it just doesn't return email.

Appreciate your help James

Community
  • 1
  • 1
TheBritishAreComing
  • 1,667
  • 2
  • 19
  • 38

2 Answers2

0

Turns out it was working, my e-mail address wasn't verified (although Facebook website said it was) so I had to add another e-mail account, verify it and then reset the original e-mail back to primary.

It worked after that.

TheBritishAreComing
  • 1,667
  • 2
  • 19
  • 38
0

self.hiddenButton.readPermissions = @[@"public_profile",@"email"];

Ahmad Labeeb
  • 1,056
  • 11
  • 21