Google Sign In not working on iOS 10 Beta 7 with Xcode 8 beta 6

前端 未结 7 2424
后悔当初
后悔当初 2020-12-15 09:30

I have an app in the app store which worked perfectly fine till first few betas of iOS 10 (i am not exactly sure which one). It also works perfectly fine on iOS 9.3.

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 09:54

    I am able to find a solution in my case by fixing my code to present a subview properly. Before I was getting this warning but ignored it:

    Warning :-Presenting view controllers on detached view controllers is discouraged
    

    until I saw Pranoy C's answer. My code is structured in a very similar way that a view container is used to present subviews which contain the Google button. It was not using the container correctly to present a subview. So I followed Apple's guide, especially this block:

    - (void) displayContentController: (UIViewController*) content {
        [self addChildViewController:content];
        content.view.frame = [self frameForContentController];
        [self.view addSubview:self.currentClientView];
        [content didMoveToParentViewController:self];
    }
    

    Once the warning was gone, Google started to work properly.

    As far as root cause of this issue, I'm still not exactly sure, but the warning seems to be a hint. It has to do with detached view controllers. (I'm not super experienced at iOS coding, so if someone has more knowledge with views, view controllers, feel free to chime in.)

提交回复
热议问题