Class GoogleSignInService
- java.lang.Object
-
- edu.cnm.deepdive.teamassignmentsandroid.service.GoogleSignInService
-
public class GoogleSignInService extends Object
Uses Google Sign-In to authenticate a user with Google credentials.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Task<GoogleSignInAccount>
completeSignIn(Intent data)
Task to complete the sign in process.GoogleSignInAccount
getAccount()
Will retrieve users account once sign in is successful.static GoogleSignInService
getInstance()
Gets Instance of google sign in service.io.reactivex.Single<GoogleSignInAccount>
refresh()
Will refresh users account for secure connection without need to log in again.io.reactivex.Single<String>
refreshBearerToken()
User credentials will be sent for authentication.static void
setContext(Application context)
Sets context for Application.Task<Void>
signOut()
Task to sign user out of account.void
startSignIn(Activity activity, int requestCode)
Starts sign in process for login activity.
-
-
-
Method Detail
-
setContext
public static void setContext(Application context)
Sets context for Application.- Parameters:
context
-
-
getInstance
public static GoogleSignInService getInstance()
Gets Instance of google sign in service.- Returns:
- returns instance of google sign in serive.
-
getAccount
public GoogleSignInAccount getAccount()
Will retrieve users account once sign in is successful.- Returns:
- users account once authenticated.
-
refresh
public io.reactivex.Single<GoogleSignInAccount> refresh()
Will refresh users account for secure connection without need to log in again.- Returns:
- return single account
-
refreshBearerToken
public io.reactivex.Single<String> refreshBearerToken()
User credentials will be sent for authentication.- Returns:
- bearer token on refresh.
-
startSignIn
public void startSignIn(Activity activity, int requestCode)
Starts sign in process for login activity.- Parameters:
activity
- making the callrequestCode
- to verify account
-
completeSignIn
public Task<GoogleSignInAccount> completeSignIn(Intent data)
Task to complete the sign in process.- Parameters:
data
- for Intent of user- Returns:
- Task to complete sign in.
-
-