I need to facebook login via custom button.
So I made following method.
- (IBAction)loginWithFBClick:(UIButton *)sender
{
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
login.loginBehavior = FBSDKLoginBehaviorNative;
[login
logInWithReadPermissions: @[@"public_profile"]
fromViewController:self
handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
NSLog(@"Process error:%@",error);
} else if (result.isCancelled) {
NSLog(@"Cancelled");
} else {
NSLog(@"Logged in");
HomeViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"HomeVC"];
[self.navigationController pushViewController:vc animated:YES];
}
}];
}
After that I check in real device (iPhone 5s(iOS 9.0)) but It is opening browser for login.
I have installed and logged in facebook app in my device.
though I am facing this problem.
Please help me.