“URL方案com-google-gidconsent”没有注册处理程序在使用GIDSignIn唱歌时出错 [英] "There is no registered handler for URL scheme com-google-gidconsent" error when singning in using GIDSignIn
问题描述
我手动将google登录集成在sdk(不是cocoapods)中,并且构建正常,但是当我运行项目时,我总是在登录后收到此错误:
I have manually integrated the google sign in sdk (not with cocoapods) and it builds ok, but when I run the project I always get this errors, after signing in:
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。
This is how I am using the sdk.
首先,我按照 https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift 。
代码:
AppDelegate.swift
Code:
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!) {
}
ViewController.swift
ViewController.swift
override func viewDidLoad() {
super.viewDidLoad()
// google plus
//GIDSignIn.sharedInstance().clientID = clientID
GIDSignIn.sharedInstance().uiDelegate = self
GIDSignIn.sharedInstance().signIn()
}
可能是什么问题?我正在使用SDK版本2.2.0
What can be the issue ? I am using SDK version 2.2.0
推荐答案
您的实施没有问题。所有这些警告意味着每个URL方案所引用的应用程序都未安装在设备上。
There's no problem with your implementation. All those warnings mean is the apps which each URL scheme refer to are not installed on the device.
如果您在模拟器上进行测试,您将会收到这些错误每时每刻。但是,如果您在设备上进行测试,则可以验证如果安装了相应的应用程序,错误将会消失。
If you're testing on the simulator, you'll get those errors all the time. But, if you test on a device, you can verify the errors will be gone if you have the corresponding apps installed.
例如,如果您有Youtube应用程序您的设备,您将看不到该行:
For example, if you have the Youtube app on your device, you won't see the line:
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方案com-google-gidconsent”没有注册处理程序在使用GIDSignIn唱歌时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!