Google Sign In showing blank screen in iOS

2019-03-06 15:52发布

I have implemented code as per the google SDK documentation line by line in my app, but still when I click on google sign in button app shifts to new view controller with webview with blank screen. Have tried multiple solution found here : GIDSignIn white screen on iOS 91. But no lucks with resolving the problem , have attached the screen shot for getting closer look about the screen. Blank Screen after clicking on Google Sign In button

Following are the pods that I'm using,

Pod List

Running XCode 9.1, iOS 10.0 and later. Kindly request someone to help.

Update: View Hierarchy enter image description here

Update: viewDidLoad's code:

 GIDSignIn.sharedInstance().uiDelegate = self
    if self.isChangePassword {
        self.addSignInView()
    }
    else {
        self.addSignUpView()
    }

fileprivate func addSignInView() {
    guard let signInEmailView: SignInEmailView = Bundle.main.loadNibNamed(NibNames.SignInEmailView.rawValue, owner: self, options: nil)?[0] as? SignInEmailView
        else {
            return
    }
    signInEmailView.delegate = self
    gaManager.trackScreen(screenName: ScreenNames.SignIn.rawValue)
    self.animateView(signInEmailView)

}

fileprivate func addSignInView() {
    guard let signInEmailView: SignInEmailView = Bundle.main.loadNibNamed(NibNames.SignInEmailView.rawValue, owner: self, options: nil)?[0] as? SignInEmailView
        else {
            return
    }
    signInEmailView.delegate = self
    gaManager.trackScreen(screenName: ScreenNames.SignIn.rawValue)
    self.animateView(signInEmailView)

}

2条回答
Luminary・发光体
2楼-- · 2019-03-06 16:35

Finally after so many days found the problem. I was showing splash view from my appDelegate using refrence of UIWindow which was adding and removing an imgview as subview to the window. So it was somehow messing with the UINavigation's stack and my view controller was not getting any reference to the UINavigationController. After removing that code it's working just fine. Also came to the solution that, if I want to show splash screen, as I can't use UIWindow's reference, I have to add new VC and write my all navigation code there. @TedYu Thank you very much for the help. :)

查看更多
ら.Afraid
3楼-- · 2019-03-06 16:45

I have the same problem. I use the UIAlertView to confirm user really want to do authorization. It will show the blank screen. If I remove the UIAlertView and show the authorization view directly. It works fine. The problem also show in the Dropbox authorization screen. If you not use UIAlertView , please try to pass the top most controller

https://github.com/dropbox/dropbox-sdk-obj-c/issues/182

Hope this can do some help.

查看更多
登录 后发表回答