Start a new topic
Answered

Can't login with facebook in ios10

I have an app which have the option to login with facebook credentials and it works fine on iOS 9. However, it does not work in ios10. I always get the error 308 after enter the facebook credentials and hit done.


Has this something to do with facebook sdk or kinvey sdk? I am using the newest version of both.


Thanks in advance


Best Answer

1.40.9 Kinvey but now downloading 3.3.0 to check if the problem gets solved.


I'm not getting the same errors. The problem with facebook SDK is the new feature on Xcode 8 I think, just enabling Keychain on target capabilities worked for me


1 person has this question

Joao,

If you keep the same Kinvey version and downgrade the FB SDK does it work for you?

Thanks,
Pranav
Kinvey Support

 

I solved the problem with facebook SDK but now Kinvey doesn't login

You have to enable Keychain on your project on xcode to have the fb SDK running

Sandor,


  • What was your facebook sdk version and kinvey library version?
  • Are you getting the same error as Joao?


Thanks,
Pranav
Kinvey Support

Answer

1.40.9 Kinvey but now downloading 3.3.0 to check if the problem gets solved.


I'm not getting the same errors. The problem with facebook SDK is the new feature on Xcode 8 I think, just enabling Keychain on target capabilities worked for me

It worked for me too! Thank you Sandor! You saved my life!!! 

Regards


1 person likes this

João, can you post the code you're using to log the user in Kinvey using facebook credentials?? I can't manage to do that event login correctly on facebook

Sure:


This is a custom button (not the plain old default "login with facebook") initialization:


[[self customLoginButton]

    addTarget:self

    action:@selector(loginButtonClicked) forControlEvents:UIControlEventTouchDown];


And this is the method associated with the button:


-(void)loginButtonClicked {

 

    FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];

    [login

    logInWithReadPermissions: @[@"public_profile", @"email", @"user_friends", @"user_birthday", @"user_location", @"user_hometown"]

    fromViewController:self

    handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {

        if (error) {

            NSLog(@"Process error");

        } else if (result.isCancelled) {

            NSLog(@"Cancelled");

        } else {

            NSLog(@"Logged in");

            NSString* acessToken = [[result token] tokenString];

 

            [self didTapLogInWithFB:acessToken];

            [[self customLoginButton] setTitle:@"Logout Facebook" forState:UIControlStateNormal];

        }

    }];

}

Great, thank you!

Login or Signup to post a comment