Google Sign In showing blank screen in iOS

有些话、适合烂在心里 提交于 2020-01-30 10:32:47

问题


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.

Following are the pods that I'm using,

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

Update: View Hierarchy

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)

}

回答1:


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.




回答2:


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. :)



来源:https://stackoverflow.com/questions/47834443/google-sign-in-showing-blank-screen-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!