I am integrating FacebookSDK 4.x integration with custom UI and using following method to log-in and also getting email permission from user.
FBSDKLoginManag
I resolved issue by recalling the method :
[login logInWithReadPermissions:@[@"email"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error)
I need to pass auth_type: 'rerequest' while requesting again and i get it in the documentation of this method i get the description :
Use this method when asking for read permissions. You should only ask for permissions when they are needed and explain the value to the user. You can inspect the result.declinedPermissions to also provide more information to the user if they decline permissions.
If
[FBSDKAccessToken currentAccessToken]
is not nil, it will be treated as a reauthorization for that user and will pass the "rerequest" flag to the login dialog.
just the problem was i was calling logout Method of FbSDKLoginManager class. This will clear the token and it will takes it as the old permission not re-requested permission.
You actually don't need to pass or call auth_type:rerequest. This is already done by facebook. If you check FBSDKLoginManager, the code does it for you.
-(NSDictionary *)logInParametersWithPermissions:(NSSet *)permissions
{
if ([FBSDKAccessToken currentAccessToken])
{
loginParams[@"auth_type"] = @"rerequest";
}
}