In my application i am doing login with facebook via FacebookSDK.framework
- (IBAction)facebookLoginBtn1:(id)sender {
[FBSession openActiveSessionWithReadPermissions:@[@"email"] allowLoginUI:YES completionHandler:
^(FBSession *session, FBSessionState state, NSError *error) {
AppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
[appDelegate sessionStateChanged:session state:state error:error];
[[FBRequest requestForMe] startWithCompletionHandler:
^(FBRequestConnection *connection,
NSDictionary<FBGraphUser> *user,
NSError *error) {
if (!error) {
NSString *firstName = user.first_name;
NSString *lastName = user.last_name;
NSString *facebookId = user.id;
NSString *email = [user objectForKey:@"email"];
NSString *imageUrl = [[NSString alloc] initWithFormat: @"http://graph.facebook.com/%@/picture?type=large", facebookId];
NSLog(@"%@",email);
NSLog(@"%@",user.id);
NSLog(@"%@",imageUrl);
}
else
{
}
}];
}];
}
and code working in my old application , but i am getting only FB id and user name here. I have tried with diffrent types of permissions and facebook id's but can not able to find out what is the problem here .
I have done whole set up perfectly in info plist and facebook developer portle. i am getting only below response as FBGraphUser object
{
id = FB id;
name = “user name here“;}
as responce . Here no email id i am getting. Can any one help me out here. Its supposed to be minor thing that i am missing.