Class GoogleConnect
The GoogleConnect Login class allows the sign in with google functionality. The GoogleConnect requires to create a corresponding google cloud project. To enable the GoogleConnect to sign-in on the Simulator create a corresponding web login - https://developers.google.com/+/web/signin/
To enable the GoogleConnect to sign-in on Android Follow step 1 from here - https://developers.google.com/+/mobile/android/getting-started
To enable the GoogleConnect to sign-in on iOS follow step 1 from here - https://developers.google.com/+/mobile/ios/getting-started
-
Method Summary
Modifier and TypeMethodDescriptionprotected Oauth2Creates the oauth2 to be used to login in case no native login is available for this service.static GoogleConnectGets the GoogleConnect singleton instance .booleanReturns true if this service supports native login.protected booleanvalidateToken(String token) Returns true if the previous granted access token is still valid otherwise false.Methods inherited from class Login
addScopes, connect, doLogin, doLogin, doLogout, getAccessToken, isPreferRedirectPrompt, isUserLoggedIn, nativeIsLoggedIn, nativelogin, nativeLogout, setAccessToken, setCallback, setClientId, setClientSecret, setOauth2URL, setPreferRedirectPrompt, setRedirectURI, setScope, validateTokenModifier and TypeMethodDescriptionAdds the given scopes to the OAuth2 login request.connect()Connects to the login service asynchronously, automatically logging in if not yet logged in.voiddoLogin()Logs in the user.voiddoLogin(LoginCallback callback) Initiates login using the given single-use callback.voiddoLogout()Logs out the current userThe AccessToken of this servicebooleanA flag used by the javascript port to indicate that the login will use a redirect for the prompt instead of a popup.booleanIndicates if the user is currently logged inbooleanIndicates if the user is currently logged in.voidLogs in the current user natively.voidLogs out the current user natively.voidsetAccessToken(AccessToken token) Sets the Login access tokenvoidSets the login callback that will receive event callback notification from the APIvoidsetClientId(String id) The client id (appid) which asks to connectvoidsetClientSecret(String secret) The client secretvoidsetOauth2URL(String oauth2URL) The oauth2 URLvoidsetPreferRedirectPrompt(boolean preferRedirectPrompt) A flag used by the javascript port to indicate that the login will use a redirect for the prompt instead of a popup.voidsetRedirectURI(String redirectURI) The redirect URIvoidThe authentication scopevoidThis method tries to validate the last access token if exists, if the last token is not valid anymore it will try to login the user in order to get a fresh token The method blocks until a valid token has been grantedMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Method Details
-
getInstance
Gets the GoogleConnect singleton instance .
Returns
the GoogleConnect instance
-
isNativeLoginSupported
public boolean isNativeLoginSupported()Description copied from class:LoginReturns true if this service supports native login. If implementation returns true here, the nativelogin, nativelogout, nativeIsLoggedIn should be implemented
Returns
true if the service supports native login
- Specified by:
isNativeLoginSupportedin classLogin
-
createOauth2
Description copied from class:LoginCreates the oauth2 to be used to login in case no native login is available for this service.
Returns
- Overrides:
createOauth2in classLogin- Returns:
- the Oauth2 to be used to login if no native login available and on the simulator
-
validateToken
Description copied from class:LoginReturns true if the previous granted access token is still valid otherwise false.
Parameters
token: the access token to check
Returns
true of the token is valid
- Specified by:
validateTokenin classLogin
-