Updated 14 December 2016
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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"]); } }]; |
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.