Firebaseui-ios: FirebaseLoginViewController shows black screen

Created on 15 Mar 2016  ·  5Comments  ·  Source: firebase/FirebaseUI-iOS

Details:

  1. Objective-C or Swift: Swift
  2. iOS Version (7-9): 9.2
  3. CocoaPods Version: 0.39

    Explanation of your issue

Presenting a FirebaseLoginViewController modally shows a totally black screen with no way of getting out of it.

Steps to reproduce

    let loginSheet = UIAlertController(title: "Log in", message: nil, preferredStyle: .ActionSheet)
    loginSheet.addAction(UIAlertAction(title: "Existing Account", style: .Default, handler: { _ in
        let loginController = FirebaseLoginViewController(ref: FB.baseRef())
        loginController.enableProvider(.Password)
        loginController.didDismissWithBlock { auth, error in
            if auth != nil {
                // Handle user case
                self.updateButtonStatus()
            } else if error != nil {
                // Handle error case
                self.updateButtonStatus()
            } else {
                // Handle cancel case
                self.updateButtonStatus()
            }
        }

        self.presentViewController(loginController, animated: true, completion: nil)
    }))
    loginSheet.addAction(UIAlertAction(title: "New Account", style: .Default, handler: { _ in
        // TODO: Registration
        NSLog("Registration not currently implemented")
    }))
    loginSheet.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: nil))

    self.presentViewController(loginSheet, animated: true, completion: nil)

Most helpful comment

Yep, that fixed it. I'll send in a PR.

All 5 comments

As a side note, I tried removing the surrounding alert controller and just created the login controller and presenting it, but that also didn't work.

Something that may be interesting, even though I have animated set to true, the black screen appears immediately without any animation. Seems like an issue with the presentation.

Weird--haven't had that happen before. I don't know the behavior or using it within the UIAlertController, but it definitely shouldn't be blank when used on its own. Have you ensured that the provider is enabled in the Auth tab of your Firebase Dashboard?

I may be on to something. I see a nib file along with the other Resources for the LoginViewController but I don't see it referenced anywhere. Let me see if I can get this working and I'll report back with my findings.

Yep, that fixed it. I'll send in a PR.

Cool, thanks. It should be automagically picked up with the view controller, though CoocaPods may have severed some link when it got bundled in the resources.

Was this page helpful?
0 / 5 - 0 ratings