OpenGoogleSignInSDK icon indicating copy to clipboard operation
OpenGoogleSignInSDK copied to clipboard

Question: Handle url method

Open akivlis opened this issue 4 years ago • 2 comments

Hello, as this library is offering the same API as the GoogleSignIn library, I wanted to ask if there is any particular reason for the func handle(_ url: URL) method not returning the bool value based on the request result as it is the case for the original GoogleSignIn library. Thank you

akivlis avatar Jul 13 '21 12:07 akivlis

Hello @akivlis, thank you for your interest in using OpenGoogleSignInSDK!

We believe there is no need for func handle(_ url: URL) to return Bool, as the SDK itself takes care of handling the deeplink and finishing the flow by using native ASWebAuthenticationSession, as opposed to the official GoogleSignIn library, where handle needs to be called in func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) in order to properly handle the URL that your application receives at the end of the authentication process.

I understand this might be a little confusing when switching from the official library to OpenGoogleSignInSDK, but there should be no need for users to call func handle(_ url: URL). We should definitely mention this in the documentation/integration guide.

Or is there any case where you need to call func handle(_ url: URL) directly and use the Bool value?

IgorRosocha avatar Jul 13 '21 13:07 IgorRosocha

Hello @IgorRosocha,

thanks for the quick response. Yes, I got a little confused when switching to this library, as I was returning the value in the func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) as you mentioned.

So, you are saying that there is no need anymore to call func handle(_ url: URL) in that delegate function? This is exactly the answer I needed. Thanks :)

akivlis avatar Jul 13 '21 15:07 akivlis