Skip to content

Android plugin for Godot that uses One Tap API for login.

License

Notifications You must be signed in to change notification settings

eskandrej/one-tap-android-godot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

one-tap-android-godot

Android plugin for Godot that uses One Tap API for login.

anim

Compile Plugin

  1. Download AAR library for Android https://godotengine.org/download
  2. Rename AAR library to godot-lib.release.aar and place it in Plugin-source/app/libs
  3. Open Plugin-source folder in Android Studio
  4. Click on Build -> Make Project

Compiled plugin will be in Plugin folder and also copied in Demo project.

Running Demo

  1. Compile Plugin
  2. Open Demo/project.godot in Godot 4
  3. Create web client id following Set up your Google APIs console project
    note: App's package name is org.godotengine.onetapdemo
  4. Set your web client id in Main.gd
  5. Download and install Android Build Template from Project menu

Usage

functions:

setWebClientID(webClientId: String)
Set this function before calling any other. For web client ID follow https://developers.google.com/identity/one-tap/android/get-started#api-console
signIn(authorizedAccounts: Boolean, autoSelect: Boolean)
authorizedAccounts:
Sets whether to only allow the user to select from Google accounts that are already authorized to sign in to your application. If true, the user will not be able to select any Google account that would otherwise require explicit authorization to share basic profile/email data with your application. This may reduce some friction in the sign-in user journey, and guarantees that the returned credential is for a "returning user", but limits the user's freedom to choose among all the Google accounts on the device
autoSelect:
Sets the auto-select behavior in the request. For users who opt-in, Auto Select allows a credential to be selected automatically without waiting for a user action (such as tapping on the "continue" button). A credential can be auto selected if 1) only one credential can be used for sign-in; and 2) no further actions need to be taken for this credential (for example, data sharing permissions are already collected for a Google account).
signOut()
Signs out

signals:

on_success(data:Dictionary)
When the login succeeds, it returns dictionary data(fields could be null):

data.id
data.displayName
data.givenName
data.familyName
data.profilePictureUri
data.password
data.googleIdToken
data.phoneNumber
on_error(error:Dictionary)
Returns error code and message.

error.code
error.message

About

Android plugin for Godot that uses One Tap API for login.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages