Contents

tibimac/googlesigninkit

This module is intended to be used to do a "Google Sign-In" for your app.

First flow

Start by configuring the module by giving it a configuration (GoogleSignInKit.Manager.Configuration) through a call to the function configure(configuration:). This is only needed once in your app lifecycle. So you can do it from your AppDelegate or at init of your login view controller.

Then once sign-in is required call the function signIn(overrideConfig:completion:). Through this function you can override some parameters of the module configuration (but not the client ID) just for the time of the authentication by giving an optional GoogleSignInKit.Configuration struct. And of course give your completion block in which you'll receive the GoogleSignInKit.Credentials struct with all you need to do the sign-up / sign-in. If you need to repeat the sign-in you can call this function again.

Second flow

When sign-in is required just call the function signIn(configuration:completion:). Through this single function you can set the module configuration and start sign-in. As a second parameter of course give your completion block in which you'll receive the GoogleSignInKit.Credentials struct with all you need to do the sign-up / sign-in. If you need to repeat the sign-in you can either call this function again or call signIn(overrideConfig:completion:), it's up to you.

Need Demo ?

Here's a GoogleSignInKit-Demo project

Package Metadata

Repository: tibimac/googlesigninkit

Default branch: main

README: README.md