Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Parse SDK: How to check if login is from Facebook or Twitter?

I have an app that allows users to log in to either Facebook or Twitter. There is a single

-(void)logInViewController:(PFLogInViewController )logInController didLogInUser:(PFUser )user

method that manages login from the PFLogInViewController. How do I check if user pressed the Facebook login button or the Twitter login button? I have functionality in my app that requires a different setup depending on the log in type.

like image 635
Tom Testicool Avatar asked May 29 '14 19:05

Tom Testicool


1 Answers

in logInViewController:didLogInUser: … check this

BOOL linkedWithFacebook = [PFFacebookUtils isLinkedWithUser:user];
BOOL linkedWithTwitter = [PFTwitterUtils isLinkedWithUser:user];

If it’s none of the above… it’s logged with "normal” PARSE username / password…

Happy codding!

like image 196
TonyMkenu Avatar answered Nov 20 '22 16:11

TonyMkenu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!