FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init];
// Optional: Place the button in the center of your view.
loginButton.readPermissions =
@[@"public_profile", @"email", @"user_friends"];
loginButton.center = self.view.center;
[self.view addSubview:loginButton];
// [FBSession setActiveSession: [[FBSession alloc] initWithPermissions:permissions]];
if ([FBSDKAccessToken currentAccessToken]) {
NSLog(@"dddd%@",loginButton.readPermissions);
// User is logged in, do work such as go to next view controller.
}
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(@"fetched user:%@ and Email : %@HH%@", result,result[@"email"],result[@"id"]);
}
}];