Google

TerraCore v0

Login your user with Google account

Installation#

implement("vn.teko.android.auth:terra-auth:$version")
implement("vn.teko.android.auth:google-login:$version")

Enable Google login method in Terra Console#

Please contact us we will setup it for you.
You will need to create client then give us the Google ClientID

Usage#

Inside a Fragment or Activity, call this function

TerraAuth.getInstance(terraApp).loginWithGoogle(this, object : LoginCallback {
override fun onResult(result: Result<Unit, Throwable>) {
when (result) {
is Result.Success -> // handle successful login
is Result.Failure -> // handle failure login
}
}
override fun onIAMLoginStart() {
}
})

After logging in success, you now have the access_token. Please continue to Access Token Usage for usage guide.