I am trying to determine how a user logs in using Parse, either signing in with username and password, logging in with Facebook, or login in with Twitter. I have in my delegate method
- (void)logInViewController:(PFLogInViewController *)logInController didLogInUser:(PFUser *)user {
BOOL isLinkedToTwitter = [PFTwitterUtils isLinkedWithUser:[PFUser currentUser]];
BOOL isLinkedToFacebook = [PFFacebookUtils isLinkedWithUser:[PFUser currentUser]];
if (isLinkedToFacebook) {
//Facebook
NSLog(@"Facebook");
}
if (isLinkedToTwitter) {
//Twitter
NSLog(@"Twitter");
}
else {
//Normal
NSLog(@"Regular Login");
}
The issue is that the else tag is being fired every time. If I login with Facebook, I get the Facebook NSLog and the Regular one. If I login with Twitter I get the Twitter NSLog and the regular one. What am I doing wrong here?
Change your second
iftoelse ifso that it only triggers one of the options