Class GoogleSignInManager
- Namespace
- Uralstech.UMoth.GoogleSignIn
Class to handle Google account sign-in.
public class GoogleSignInManager : DontCreateNewSingleton<GoogleSignInManager>, IGoogleAuthCallbackReceiver
- Inheritance
-
objectGoogleSignInManager
- Implements
Fields
AndroidNativeClass
The fully qualified name of the Kotlin plugin class.
public const string AndroidNativeClass = "com.uralstech.umoth.GoogleAuth"
Field Value
- string
OnSignInFailed
Called when the sign-in flow fails, with the failure reason.
public UnityEvent<SignInFailReason> OnSignInFailed
Field Value
- UnityEvent<SignInFailReason>
OnSignOutFailed
Called when the sign-out flow fails.
public UnityEvent OnSignOutFailed
Field Value
- UnityEvent
OnSignedIn
Called when the sign-in flow succeeds, with the The Google ID Token credential.
public UnityEvent<GoogleIdTokenCredential> OnSignedIn
Field Value
- UnityEvent<GoogleIdTokenCredential>
OnSignedOut
Called when the sign-out flow succeeds.
public UnityEvent OnSignedOut
Field Value
- UnityEvent
_callbackReceiver
The native callback receiver.
protected GoogleAuthCallbackReceiver _callbackReceiver
Field Value
_pluginInstance
The native plugin instance.
protected AndroidJavaObject? _pluginInstance
Field Value
- AndroidJavaObject?
Properties
ServerClientId
The server's client ID to use as the audience for Google ID tokens generated during the sign-in.
public string ServerClientId { protected get; set; }
Property Value
- string
Methods
Awake()
protected override void Awake()
OnDestroy()
protected void OnDestroy()
SignIn(string?, bool, bool)
Starts the Google Sign-In flow.
public void SignIn(string? nonce = null, bool filterByAuthorizedAccount = true, bool autoSelectSignIn = true)
Parameters
nonce
stringThe nonce to use when generating a Google ID token.
filterByAuthorizedAccount
boolWhether to only allow the user to select from Google accounts that are already authorized to sign in to your application.
autoSelectSignIn
boolThe auto-select behavior in the request.
SignInAsync(string?, bool, bool)
Starts the Google Sign-In flow.
public Awaitable<(GoogleIdTokenCredential?, SignInFailReason)> SignInAsync(string? nonce = null, bool filterByAuthorizedAccount = true, bool autoSelectSignIn = true)
Parameters
nonce
stringThe nonce to use when generating a Google ID token.
filterByAuthorizedAccount
boolWhether to only allow the user to select from Google accounts that are already authorized to sign in to your application.
autoSelectSignIn
boolThe auto-select behavior in the request.
Returns
- Awaitable<(GoogleIdTokenCredential, SignInFailReason)>
The ID token credential or the failure reason.
SignOut()
Starts the sign-out flow.
public void SignOut()
SignOutAsync()
Starts the sign-out flow.
public Awaitable<bool> SignOutAsync()
Returns
- Awaitable<bool>
If the operation was successful.