now I used the latest SDK v4.26.0 , downloaded from here , and I followed the link for the installation steps for FB. and my code
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; if ([[[UIDevice currentDevice] systemVersion] floatValue] <= 9) { // After iOS9 we can not use it anymore login.loginBehavior = FBSDKLoginBehaviorSystemAccount; } else { login.loginBehavior = FBSDKLoginBehaviorWeb; } NSArray *permission = [[NSArray alloc] initWithObjects:@"email",@"public_profile",@"user_friends", nil]; NSLog( @"### running FB sdk version: %@", [FBSDKSettings sdkVersion] ); [login logInWithReadPermissions:permission fromViewController:(UIViewController *)self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { [self removeActivityIndicatorWithBg:activityIndicator]; if (error) { NSLog(@"Process error"); } else if (result.isCancelled) { NSLog(@"Cancelled"); } else { NSLog(@"Logged in%@",result.grantedPermissions); } }];
here I used login behavior as FBSDKLoginBehaviorSystemAccount and I got an error like
(- error: "Operation could not be performed. -10814)
therefore, in my simulator or device there are no account settings in the system settings for facebook. then it appears on the next block
if (error) { NSLog(@"Process error"); }
if I print a mistake
No Facebook account. There are no Facebook accounts configured. You can add or create a Facebook account in the settings.
so I changed loginBehavior from FBSDKLoginBehaviorSystemAccount to FBSDKLoginBehaviorWeb , I got all OP with an error
source share