Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
439 views
in Technique[技术] by (71.8m points)

ios - "There is no registered handler for URL scheme com-google-gidconsent" error when singning in using GIDSignIn

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

This is how I am using the sdk.

First I follow all the steps from https://developers.google.com/identity/sign-in/ios/sign-in?ver=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

 override func viewDidLoad() {
        super.viewDidLoad()

        // google plus
        //GIDSignIn.sharedInstance().clientID = clientID
        GIDSignIn.sharedInstance().uiDelegate = self
        GIDSignIn.sharedInstance().signIn()
}  

What can be the issue ? I am using SDK version 2.2.0

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...