Google登录不支持使用Xcode 8 beta 6的iOS 10 Beta 7

Pra*_*y C 12 xcode objective-c ios google-signin ios10

我在应用程序商店中有一个应用程序非常好,直到iOS 10的前几个测试版(我不确定哪一个).它在iOS 9.3上也能完美运行.

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

这是我的代码:

[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];
Run Code Online (Sandbox Code Playgroud)

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

截图1

它只是像这样停滞不前.

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

截图2

单击完成按钮会将我发回我的应用程序.

控制台中没有记录错误.

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

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)]
Run Code Online (Sandbox Code Playgroud)

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

Bas*_*eer 9

Google SignIn示例iOS项目也存在同样的问题.

它返回:

"Error Domain=com.google.GIDSignIn Code=-2 "keychain error" UserInfo={NSLocalizedDescription=keychain error}"
Run Code Online (Sandbox Code Playgroud)

这似乎是一个错误.


Pra*_*y C 1

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

我使用了一个自定义视图容器,在其中我将 Google 的登录视图控制器显示为子视图。因此,在将自定义视图控制器添加到容器之前,我必须执行[self.view layoutIfNeeded]其他操作,因为视图布局尚未设置,因此 google 的 sdk 可能会使用内部某处的宽度/高度。

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