Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.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 &引用;没有URL方案com的已注册处理程序“同意”;使用GIDSignIn进行Singing时出错_Ios_Swift_Google Signin - Fatal编程技术网

Ios &引用;没有URL方案com的已注册处理程序“同意”;使用GIDSignIn进行Singing时出错

Ios &引用;没有URL方案com的已注册处理程序“同意”;使用GIDSignIn进行Singing时出错,ios,swift,google-signin,Ios,Swift,Google Signin,我已经手动集成了google sign-in sdk(不使用cocoapods),它构建的很好,但是当我运行项目时,我总是在登录后出现以下错误: 2015-09-07 15:44:14.071 Contacts++[82438:4826277] LaunchServices: ERROR: There is no registered handler for URL scheme com-google-gidconsent-google 2015-09-07 15:44:14.071 Conta

我已经手动集成了google sign-in sdk(不使用cocoapods),它构建的很好,但是当我运行项目时,我总是在登录后出现以下错误:

2015-09-07 15:44:14.071 Contacts++[82438:4826277] LaunchServices: ERROR: There is no registered handler for URL scheme com-google-gidconsent-google
2015-09-07 15:44:14.071 Contacts++[82438:4826277] LaunchServices: ERROR: There is no registered handler for URL scheme com-google-gidconsent-youtube
2015-09-07 15:44:14.072 Contacts++[82438:4826277] LaunchServices: ERROR: There is no registered handler for URL scheme com-google-gidconsent
2015-09-07 15:44:14.072 Contacts++[82438:4826277] LaunchServices: ERROR: There is no registered handler for URL scheme com.google.gppconsent.2.4.1
2015-09-07 15:44:14.072 Contacts++[82438:4826277] LaunchServices: ERROR: There is no registered handler for URL scheme com.google.gppconsent.2.4.0
这就是我使用sdk的方式

首先,我遵循的所有步骤

代码:
AppDelegate.swift

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {  
    // google
    // Initialize sign in
    GIDSignIn.sharedInstance().clientID = "<client id>"
    GIDSignIn.sharedInstance().delegate = self

    return true
}

func signIn(signIn: GIDSignIn!, didSignInForUser user: GIDGoogleUser!, withError error: NSError!) {

    if error == nil {
        let userID = user.userID
        let idToken = user.authentication.idToken
        let name = user.profile.name
        let email = user.profile.email

        print(userID, idToken, name, email)
    } else {
        print(error.localizedDescription)
    }
}

func signIn(signIn: GIDSignIn!, didDisconnectWithUser user: GIDGoogleUser!, withError error: NSError!) {

}

问题是什么?我正在使用SDK 2.2.0版

您的实现没有问题。所有这些警告意味着每个URL方案引用的应用程序都没有安装在设备上

如果你在模拟器上测试,你会一直得到这些错误。但是,如果您在设备上进行测试,您可以验证如果安装了相应的应用程序,错误是否会消失

例如,如果您的设备上有Youtube应用程序,您将看不到以下行:

2015-09-07 15:44:14.071 Contacts++[82438:4826277] LaunchServices: ERROR: There is no registered handler for URL scheme com-google-gidconsent-youtube

您的实现没有问题。所有这些警告意味着每个URL方案引用的应用程序都没有安装在设备上

如果你在模拟器上测试,你会一直得到这些错误。但是,如果您在设备上进行测试,您可以验证如果安装了相应的应用程序,错误是否会消失

例如,如果您的设备上有Youtube应用程序,您将看不到以下行:

2015-09-07 15:44:14.071 Contacts++[82438:4826277] LaunchServices: ERROR: There is no registered handler for URL scheme com-google-gidconsent-youtube

请详细说明这是如何回答问题的。请详细说明这是如何回答问题的。
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com"]];
        exit(0);
})