Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 允许后,Google登录将重定向到Google.com而不是应用程序_Ios_Swift_Gmail_Ios10_Google Signin - Fatal编程技术网

Ios 允许后,Google登录将重定向到Google.com而不是应用程序

Ios 允许后,Google登录将重定向到Google.com而不是应用程序,ios,swift,gmail,ios10,google-signin,Ios,Swift,Gmail,Ios10,Google Signin,允许后,Google登录将重定向到Google.com而不是应用程序。这是iOS 10的一个问题,但在其他具有最新iOS版本的设备中可以正常工作。请给出一些解决方案。 提前谢谢你 显示一些代码您是如何操作的,是否来自文档,如果是,则检查您的URL方案Plist是否设置正确。通过在应用程序中添加和实现委托方法,最终解决了此问题 GIDSignIn.sharedInstance().clientID = "your_client_id" GIDSignIn.sharedInstance().dele

允许后,Google登录将重定向到Google.com而不是应用程序。这是iOS 10的一个问题,但在其他具有最新iOS版本的设备中可以正常工作。请给出一些解决方案。
提前谢谢你

显示一些代码您是如何操作的,是否来自文档,如果是,则检查您的URL方案Plist是否设置正确。

通过在应用程序中添加和实现委托方法,最终解决了此问题

GIDSignIn.sharedInstance().clientID = "your_client_id"
GIDSignIn.sharedInstance().delegate = self
我有facebook和google登录,所以我像这样返回了这两种方法

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {

    let handled = FBSDKApplicationDelegate.sharedInstance().application(app, open: url, options: options)
    let googleHandler = GIDSignIn.sharedInstance().handle(url, sourceApplication: "com.apple.SafariViewService", annotation: nil)
    return handled || googleHandler
}
 // [END openurl]
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
    let checkFB = FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
    let checkGoogle = GIDSignIn.sharedInstance().handle(url as URL?,sourceApplication: sourceApplication,annotation: annotation)
    return checkGoogle || checkFB
}

我已经根据提供的文档和URL方案添加了代码。它适用于ios版本为11的设备,但在ios版本为10的设备上存在问题。为什么只有ios 10才会出现这种情况?