Skip to content
This repository has been archived by the owner on Oct 5, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
stevdza-san committed Oct 22, 2023
2 parents c884cb1 + 42272cf commit e7993bf
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">One-Tap Sign in with Google</h1></br>

<p align="center">
<a href="https://jitpack.io/#stevdza-san/OneTapCompose/1.0.7"><img alt="License" src="https://badgen.net/badge/Jitpack/1.0.7/orange?icon=github"/></a>
<a href="https://jitpack.io/#stevdza-san/OneTapCompose/1.0.8"><img alt="License" src="https://badgen.net/badge/Jitpack/1.0.8/orange?icon=github"/></a>
<a href="https://github.com/stevdza-san"><img alt="Profile" src="https://badgen.net/badge/Github/stevdza_san/green?icon=github"/></a>
</p><br>

Expand All @@ -12,17 +12,18 @@ It hides all the boilerplate code away from you.

<p align="center">
<img src="https://github.com/stevdza-san/OneTapCompose/blob/master/previews/OneTap.gif" width="268"/>
<img src="https://github.com/stevdza-san/OneTapCompose/blob/master/previews/OneTap2.gif" width="268"/>
</p>

## Download
<a href="https://jitpack.io/#stevdza-san/OneTapCompose/1.0.7"><img alt="License" src="https://badgen.net/badge/Jitpack/1.0.7/orange?icon=github"/></a>
<a href="https://jitpack.io/#stevdza-san/OneTapCompose/1.0.8"><img alt="License" src="https://badgen.net/badge/Jitpack/1.0.8/orange?icon=github"/></a>

### Gradle

Add the dependency below to your module's `build.gradle` file:
```gradle
dependencies {
implementation("com.github.stevdza-san:OneTapCompose:1.0.7")
implementation("com.github.stevdza-san:OneTapCompose:1.0.8")
}
```
Add a repository in your `settings.gradle` file:
Expand Down Expand Up @@ -64,6 +65,26 @@ Button(onClick = { state.open() }) {
}
```

And if you wish to extract a user information from a token id, that's now possible too! `getUserFromTokenId()` allows you to do exactly that. It returns a `GoogleUser` object, that contains lot's of different information related to that same user.

```kotlin
onTokenIdReceived = { tokenId ->
Log.d("LOG", getUserFromTokenId(tokenId).toString())
}
```

Available `GoogleUser` information:
- Sub
- Email
- EmailVerified
- FullName
- GivenName
- FamilyName
- Picture
- IssuedAt
- ExpirationTime
- Locale

## Troubleshoot
In some cases you may encounter <i>"Google Account not Found."</i> message inside `onDialogDismiss` lambda, even if you have already connected a Google account
on your Android Emulator. Android emulators are prone to that issues <i>(Not sure why and when that's gonna get fixed)</i>.
Expand Down

0 comments on commit e7993bf

Please sign in to comment.