I am getting [null] value when I am fetching the user's email-id using below code. Also, I already set the permission to access the email like this.
{
self.fbLoginButton.readPermissions = @[@"public_profile", @"email", @"user_friends"];
}
Also Fetching the email details in delegate.
- (void)loginButton:(FBSDKLoginButton *)loginButton
didCompleteWithResult: (FBSDKLoginManagerLoginResult *)result
error: (NSError *)error
{
if ([FBSDKAccessToken currentAccessToken])
{
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(@"fetched user:%@", result);
NSLog(@"fetched user:%@ and Email : %@", result,result[@"email"]);
}
}];
}
}
Please provide any solution in this.
Also, I refer the FacebookSDK integration docs for the implementation link:https://developers.facebook.com/docs/facebook-login/ios#login-button