Class GoogleSignInRepository


  • public class GoogleSignInRepository
    extends Object
    Uses Google Sign In services to validate and authenticate a User and creates a Bearer token that can be used to validate and authenticate a user to the application.
    • Method Detail

      • setContext

        public static void setContext​(Application context)
        Sets the Application context to the local context variable.
        Parameters:
        context - an Application context.
      • getInstance

        public static GoogleSignInRepository getInstance()
        Loads a GoogleSignInRepository into memory.
        Returns:
        an Instance of the GoogleSignInRepository.
      • refresh

        public io.reactivex.Single<GoogleSignInAccount> refresh()
        Refreshes the validation and authentication of the account. It performs this refresh in the background.
        Returns:
        a reactivex Single of type GoogleSignInAccount.
      • refreshBearerToken

        public io.reactivex.Single<String> refreshBearerToken()
        Refreshes the Bearer Token for this application.
        Returns:
        a reactivex Single of type String.
      • startSignIn

        public void startSignIn​(androidx.activity.result.ActivityResultLauncher<Intent> launcher)
        Begins the application sign in process.
        Parameters:
        launcher - an ActivityResultLauncher object of type Intent.
      • completeSignIn

        public io.reactivex.Single<GoogleSignInAccount> completeSignIn​(androidx.activity.result.ActivityResult result)
        Signs a user into the application using a User Google account from Google Sign In services.
        Parameters:
        result - the result of the SignIn process
        Returns:
        a reactivex Single of type GoogleSignInAccount
      • signOut

        public io.reactivex.Completable signOut()
        Signs the User out of their Google account.
        Returns:
        a reactivex Completable.