I'm using the PFLogInViewController
subclass in my app to allow users to login with Facebook which works great, but if the user changes their mind and denies my app access to the Facebook account, the login stops working(as expected) but the loading indicator just spins. I never receive an error telling me that it couldn't login, it's just an infinite loop.
Any idea how to detect the failure and stop the UI from displaying the loading indicator?
Code is below, just straight subclassing with some visual tweaks.
- (void)viewDidLoad
{
[super viewDidLoad];
// Customize the default parse login view
[self setupUI];
}
- (void)setupUI {
[self.logInView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg"]]];
[self.logInView setLogo:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fdbk_logo"]]];
// Set buttons appearance
[self.logInView.facebookButton setImage:nil forState:UIControlStateNormal];
[self.logInView.facebookButton setImage:nil forState:UIControlStateHighlighted];
[self.logInView.facebookButton setBackgroundImage:[UIImage imageNamed:@"fb_login_btn"] forState:UIControlStateNormal];
[self.logInView.facebookButton setTitle:@"" forState:UIControlStateNormal];
[self.logInView.facebookButton setTitle:@"" forState:UIControlStateHighlighted];
}
This probably isn't the solution you were looking for but just my opinion:
I love Parse but I stopped using their built in controllers a while ago (PFLogin / Signup, PFQueryTableView etc) because whilst they provide decent out-the-box functionality, they're just a bit too incomplete to use in a production app. There are so many scenarios where they only provide 90% of what you want (as in your case now) and whilst they do save some time compared to rolling your own, once you do make your own you then have something you can customise as you want and re-use in the future!