public class GdxFIRAuth extends PlatformDistributor<AuthDistribution> implements AuthDistribution
AuthDistribution,
PlatformDistributorplatformObject| Modifier | Constructor and Description |
|---|---|
protected |
GdxFIRAuth()
GdxFIRAuth protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createUserWithEmailAndPassword(java.lang.String email,
char[] password,
AuthCallback callback)
Registers new user and gives response by
AuthCallback. |
protected java.lang.String |
getAndroidClassName()
Gives class name of object that will be create when application running on android platform.
|
GdxFirebaseUser |
getCurrentUser()
Gets currently logged in user or null if logged in user does not exists.
|
protected java.lang.String |
getIOSClassName()
Gives class name of object that will be create when application running on ios platform.
|
static GdxFIRAuth |
instance() |
void |
signInAnonymously(AuthCallback callback)
Signs in into application anonymously and gives response by
AuthCallback. |
void |
signInWithEmailAndPassword(java.lang.String email,
char[] password,
AuthCallback callback)
Signs in into application and gives response by
AuthCallback
If something is wrong AuthCallback.onFail(Exception) will be call. |
void |
signInWithToken(java.lang.String token,
AuthCallback callback)
Signs in into application by token and gives response by
AuthCallback. |
setMockObjectprotected GdxFIRAuth()
throws PlatformDistributorException
Instance of this class should be getting by instance()
PlatformDistributorExceptionpublic static GdxFIRAuth instance()
public GdxFirebaseUser getCurrentUser()
getCurrentUser in interface AuthDistributionGdxFirebaseUser class, may by null.public void createUserWithEmailAndPassword(java.lang.String email,
char[] password,
AuthCallback callback)
AuthCallback.createUserWithEmailAndPassword in interface AuthDistributionemail - New email addresspassword - New passwordcallback - Authorization callback, cant be null.AuthCallbackpublic void signInWithEmailAndPassword(java.lang.String email,
char[] password,
AuthCallback callback)
AuthCallback
If something is wrong AuthCallback.onFail(Exception) will be call.
signInWithEmailAndPassword in interface AuthDistributionemail - Firebase user emailpassword - Firebase user passwordcallback - Authorization callback, cant be null.AuthCallbackpublic void signInWithToken(java.lang.String token,
AuthCallback callback)
AuthCallback.
More info you about custom tokens you can find here.
signInWithToken in interface AuthDistributiontoken - Custom token from your firebase console.callback - Authorization callback, cant be null.AuthCallbackpublic void signInAnonymously(AuthCallback callback)
AuthCallback.
It may be very useful when you do not provide user authentication in your application and
working with GdxFIRDatabase or with GdxFIRStorage
because default Firebase requires authorization for database and storage actions.
signInAnonymously in interface AuthDistributioncallback - Authorization callback, cant be null.protected java.lang.String getIOSClassName()
getIOSClassName in class PlatformDistributor<AuthDistribution>protected java.lang.String getAndroidClassName()
getAndroidClassName in class PlatformDistributor<AuthDistribution>