Google登录不支持使用Xcode 8 beta 6的iOS 10 Beta 7 [英] Google Sign In not working on iOS 10 Beta 7 with Xcode 8 beta 6

查看:119
本文介绍了Google登录不支持使用Xcode 8 beta 6的iOS 10 Beta 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序商店中有一个应用程序,完全正常,直到iOS 10的几个beta(我不确定哪一个)。它在iOS 9.3上也可以正常工作。

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.

但是我没有在iOS 10 beta 7上测试,谷歌登录完全被破坏了。我从 cocoapods 使用最新版本的 GIDSignIn

However I am not testing on iOS 10 beta 7 and the google sign in is completely broken. I am using the latest version of GIDSignIn from cocoapods.

这是我的代码:

[GIDSignIn sharedInstance].clientID = [[ParseFetcher sharedInstance] getRandomParseK];
[GIDSignIn sharedInstance].delegate = sharedInstance;
[GIDSignIn sharedInstance].uiDelegate=sharedInstance;
[GIDSignIn sharedInstance].scopes = [NSArray arrayWithObjects:@"https://www.googleapis.com/auth/youtube",@"https://www.googleapis.com/auth/youtube.force-ssl", nil];
[[GIDSignIn sharedInstance] signIn];

这就是它在设备上的样子:

This is how it looks like on device:

它就像这样停滞不前。

如果我点击顶部的刷新按钮,它会尝试刷新并永远卡在这里。

If I click the refresh button at top, it tries to refresh and gets stuck here forever.

点击完成按钮会将我发回我的应用程序。

Clicking on the done button sends me back to my app.

控制台中没有记录任何错误。

There are no errors logged in the console.

然而,当我在iOS 10模拟器上运行相同的应用程序时, safari视图控制器甚至都没有打开。什么都没发生。但控制台记录了这些冗长的冗长的东西,其中以下似乎是最有用的东西,但我不知道什么是错的:

However, when I run the same app on iOS 10 simulator, the safari view controller doesn't even open. Nothing happens at all. But the console logs this long verbose stuff out of which the following seems like the most "useful" stuff but I have no clue what's wrong:

nw_endpoint_resolver_receive_report [8 i.ytimg.com:443 in_progress resolver (satisfied)] received child report:[8.1 206.248.149.148:443 waiting path (satisfied)]
2016-08-22 23:19:51.531570 XXXXAPPNAMEXXXXXXX[4561:195631] [] nw_connection_endpoint_report [8.1 206.248.149.148:443 waiting path (satisfied)] reported event path:satisfied
2016-08-22 23:19:51.531909 XXXXAPPNAMEXXXXXXX[4561:195631] [] nw_endpoint_proxy_handler_should_use_proxy Looking up proxy for hostname: <nil>, ifindex: 0
2016-08-22 23:19:51.533116 XXXXAPPNAMEXXXXXXX[4561:195631] [] -[NWConcrete_nw_endpoint_flow startWithHandler:] [8.1 206.248.149.148:443 waiting socket-flow (satisfied)]
2016-08-22 23:19:51.533548 XXXXAPPNAMEXXXXXXX[4561:195631] [] nw_endpoint_flow_setup_socket [8.1 206.248.149.148:443 in_progress socket-flow (satisfied)] creating socket
2016-08-22 23:19:51.534108 XXXXAPPNAMEXXXXXXX[4561:195631] [] nw_endpoint_flow_attach_protocols [8.1 206.248.149.148:443 in_progress socket-flow (satisfied)]
2016-08-22 23:19:51.534672 XXXXAPPNAMEXXXXXXX[4561:195631] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2016-08-22 23:19:51.535415 XXXXAPPNAMEXXXXXXX[4561:195631] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
        [x86_64] libnetcore-856.1.8
    0   libsystem_network.dylib             0x000000010c6e280e __nw_create_backtrace_string + 123
    1   libnetwork.dylib                    0x000000010e0d5194 nw_socket_add_input_handler + 3002
    2   libnetwork.dylib                    0x000000010e0b2db8 nw_endpoint_flow_attach_protocols + 3768
    3   libnetwork.dylib                    0x000000010e0b1dd5 nw_endpoint_flow_setup_socket + 563
    4   libnetwork.dylib                    0x000000010e0b0b34 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
    5   libnetwork.dylib                    0x000000010e0cbd11 nw_endpoint_handler_path_change + 1261
    6   libnetwork.dylib                    0x000000010e0cb740 nw_endpoint_handler_start + 570
    7   libnetwork.dylib                    0x000000010e0e3003 nw_endpoint_resolver_start_next_child + 2240
    8   libdispatch.dylib                   0x000000
2016-08-22 23:19:51.535995 XXXXAPPNAMEXXXXXXX[4561:195631] [] nw_endpoint_flow_attach_protocols [8.1 206.248.149.148:443 in_progress socket-flow (satisfied)] Attached flow protocol
2016-08-22 23:19:51.536475 XXXXAPPNAMEXXXXXXX[4561:195631] [] nw_endpoint_resolver_receive_report [8 i.ytimg.com:443 in_progress resolver (satisfied)] received child report:[8.1 206.248.149.148:443 in_progress socket-flow (satisfied)]

注意:iOS 9.3完美运行。也适用于所有设备 - 在iPhone 6s和iPhone 5s上测试。

NOTE: iOS 9.3 works perfectly. Also happens on all devices - tested on iPhone 6s and iPhone 5s.

推荐答案

我不确定这是否是其他人的面对,但我通过添加 [self.view layoutIfNeeded] 解决了这个问题。我知道这很奇怪,但这对我有用,我自己也不确定为什么。

I am not sure if this is what other people are facing but I solved it by adding a [self.view layoutIfNeeded]. I know this is weird but this is what worked for me, I am myself not sure why.

我正在使用自定义视图容器,我在其中显示Google的标志在视图控制器作为一个孩子。所以在将自定义视图控制器添加到容器之前,我必须执行 [self.view layoutIfNeeded] ,否则视图布局尚未设置,所以google的sdk可能使用内部某处的宽度/高度。

I was using a custom view container inside which I was showing the Google's sign in view controller as a child. So before adding the custom view controller to the container, i had to do [self.view layoutIfNeeded] as else the view layout hadn't been set yet, so google's sdk probably uses the width/height somewhere inside.

我不确定这是否是正确的解决方案,但它似乎解决了我的问题。

I am not sure if this is the right solution but it seems to have fixed my issue.

这篇关于Google登录不支持使用Xcode 8 beta 6的iOS 10 Beta 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆