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<GoogleSignInErrorCode> OnSignInFailedField Value
- UnityEvent<GoogleSignInErrorCode>
OnSignOutFailed
Called when the sign-out flow fails.
public UnityEvent OnSignOutFailedField Value
- UnityEvent
OnSignedIn
Called when the sign-in flow succeeds, with the Google ID Token credential.
public UnityEvent<GoogleIdTokenCredential> OnSignedInField Value
- UnityEvent<GoogleIdTokenCredential>
OnSignedOut
Called when the sign-out flow succeeds.
public UnityEvent OnSignedOutField Value
- UnityEvent
_callbackReceiver
The native callback receiver.
protected GoogleAuthCallbackReceiver _callbackReceiverField Value
_pluginInstance
The native plugin instance.
protected AndroidJavaObject? _pluginInstanceField 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
- noncestring
- The nonce to use when generating a Google ID token. 
- filterByAuthorizedAccountbool
- Whether to only allow the user to select from Google accounts that are already authorized to sign in to your application. 
- autoSelectSignInbool
- The auto-select behavior in the request. 
SignInAsync(string?, bool, bool, CancellationToken)
Starts the Google Sign-In flow.
public Awaitable<(GoogleIdTokenCredential?, GoogleSignInErrorCode)> SignInAsync(string? nonce = null, bool filterByAuthorizedAccount = true, bool autoSelectSignIn = true, CancellationToken token = default)Parameters
- noncestring
- The nonce to use when generating a Google ID token. 
- filterByAuthorizedAccountbool
- Whether to only allow the user to select from Google accounts that are already authorized to sign in to your application. 
- autoSelectSignInbool
- The auto-select behavior in the request. 
- tokenCancellationToken
Returns
- Awaitable<(GoogleIdTokenCredential, GoogleSignInErrorCode)>
- The ID token credential or the failure reason. 
SignOut()
Starts the sign-out flow.
public void SignOut()SignOutAsync(CancellationToken)
Starts the sign-out flow.
public Awaitable<bool> SignOutAsync(CancellationToken token = default)Parameters
- tokenCancellationToken
Returns
- Awaitable<bool>
- If the operation was successful.