I am trying to access user information, including email. For this purpose, I use the Graph API to call this method:
[facebook requestWithGraphPath:@"me" andDelegate:self];
It returns information about the user without email (birthday is also missing). I installed all permissions and tested several accounts (which have email and birthday as public information) and accepted all dialogue requests.
Here is my init:
if(!facebook) { facebook = [[Facebook alloc] initWithAppId:[self _APP_KEY] andDelegate:self]; NSArray *array = [NSArray arrayWithObjects: @"email", @"user_birthday", @"publish_stream", @"offline_access", nil]; [self setPermissions:array]; } NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if ([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"]) { facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"]; facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"]; } if (![facebook isSessionValid]) { [facebook authorize:permissions]; } else { [self getUserInfo]; }
Login callback:
- (void)fbDidLogin { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"]; [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"]; [defaults synchronize]; [self getUserInfo]; }
GetUserInfo method:
- (void) getUserInfo { [facebook requestWithGraphPath:@"me" andDelegate:self]; }
Request callback:
- (void)request:(FBRequest *)request didLoad:(id)result { if ([result isKindOfClass:[NSDictionary class]]) { NSDictionary* json = result; NSLog(@"-> %@", json); } }
The result is the following:
-> { "first_name" = EDITED (my name); gender = male; hometown = { id = 111072692249998; name = "Porto Alegre"; }; id = 653099452; languages = ( { id = 104034306299811; name = "Brazilian Portuguese"; }, { id = 106059522759137; name = English; } ); "last_name" = EDITED (my last name); link = EDITED (my profile); locale = "en_US"; location = { id = 112047398814697; name = "S\U00e3o Paulo, Brazil"; }; name = EDITED (my name); timezone = "-3"; "updated_time" = "2012-04-25T13:36:51+0000"; verified = 1; }
As you can see, there is no user email information. Am I missing a step? Any ideas?
Thanks in advance
Roger sanoli
source share