public class LoginKit
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
io.reactivex.Single<AccountInfo> |
affiliateSignUp(java.lang.String name,
java.lang.String email,
java.lang.String password,
java.lang.String token)
Affiliate partner sign up.
|
void |
affiliateSignUp(java.lang.String name,
java.lang.String email,
java.lang.String password,
java.lang.String token,
Action1<LoginResponse> onResponse)
|
void |
affiliateSignUp(java.lang.String name,
java.lang.String email,
java.lang.String password,
java.lang.String token,
Action1<LoginResponse> onResponse,
Action1<java.lang.Throwable> onError)
|
void |
affiliateSignUp(java.lang.String name,
java.lang.String email,
java.lang.String password,
java.lang.String token,
io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Affiliate partner sign up.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
affiliateSignUp(java.lang.String name,
java.lang.String email,
java.lang.String password,
java.lang.String token,
io.reactivex.functions.Consumer<AccountInfo> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Affiliate partner sign up.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
static AccountManager |
getAccountManager()
Get
AccountManager instance. |
io.reactivex.Single<java.util.List<Affiliate>> |
getAffiliates()
Get affiliate partner list.
|
void |
getAffiliates(Action1<java.util.List<Affiliate>> onResponse)
Deprecated.
|
void |
getAffiliates(Action1<java.util.List<Affiliate>> onResponse,
Action1<java.lang.Throwable> onError)
Deprecated.
|
void |
getAffiliates(io.reactivex.functions.Consumer<java.util.List<Affiliate>> onSuccess)
Get affiliate partner list.
|
void |
getAffiliates(io.reactivex.functions.Consumer<java.util.List<Affiliate>> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Get affiliate partner list.
|
static LoginKit |
getInstance()
Get
LoginKit singleton instance. |
static void |
init(android.content.Context context)
Initialization
LoginKit instance, your api token must be placed in AndroidManifest.xml
inside < application> tag like this |
static void |
init(android.content.Context context,
java.lang.String apiToken)
Initialization
LoginKit instance with an api token. |
io.reactivex.Single<AccountInfo> |
loginFacebookAccount(java.lang.String facebookToken)
Login with facebook token.
|
void |
loginFacebookAccount(java.lang.String facebookToken,
io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Login with facebook token.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
loginFacebookAccount(java.lang.String facebookToken,
io.reactivex.functions.Consumer<AccountInfo> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Login with facebook token.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
loginFacebookAccount(java.lang.String facebookToken,
LoginCallback loginCallback)
Deprecated.
|
io.reactivex.Single<AccountInfo> |
loginGooglePlusAccount(java.lang.String googlePlusToken)
Login with google plus token.
|
void |
loginGooglePlusAccount(java.lang.String googlePlusToken,
io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Login with google plus token.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
loginGooglePlusAccount(java.lang.String googlePlusToken,
io.reactivex.functions.Consumer<AccountInfo> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Login with google plus token.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
loginGooglePlusAccount(java.lang.String googlePlusToken,
LoginCallback loginCallback)
|
io.reactivex.Single<AccountInfo> |
loginWithEmailAndPassword(java.lang.String email,
java.lang.String password)
Login with email and password.
|
void |
loginWithEmailAndPassword(java.lang.String email,
java.lang.String password,
io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Login with email and password.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
loginWithEmailAndPassword(java.lang.String email,
java.lang.String password,
io.reactivex.functions.Consumer<AccountInfo> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Login with email and password.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
loginWithEmailAndPassword(java.lang.String email,
java.lang.String password,
LoginCallback loginCallback)
|
io.reactivex.Completable |
resetPassword(java.lang.String email)
Reset password of an account, given an Email associated with this account.
|
void |
resetPassword(java.lang.String email,
io.reactivex.functions.Action onComplete)
Reset password of an account, given an Email associated with this account.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
resetPassword(java.lang.String email,
io.reactivex.functions.Action onComplete,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Reset password of an account, given an Email associated with this account.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
resetPassword(java.lang.String email,
ResetPasswordCallback callback)
Deprecated.
|
void |
signUpNewProfile(java.lang.String email,
java.lang.String password,
AccountProfileProperties defaultProfile,
boolean loginOnSuccess,
LoginCallback loginCallback)
|
void |
signUpNewProfile(java.lang.String email,
java.lang.String password,
AccountProfileProperties defaultProfile,
LoginCallback loginCallback)
|
io.reactivex.Single<AccountInfo> |
signUpNewProfile(java.lang.String email,
java.lang.String password,
boolean loginOnSuccess,
ProfileProperties defaultProfile)
Sign up with email and password.
|
void |
signUpNewProfile(java.lang.String email,
java.lang.String password,
boolean loginOnSuccess,
ProfileProperties defaultProfile,
io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Sign up with email and password.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
void |
signUpNewProfile(java.lang.String email,
java.lang.String password,
boolean loginOnSuccess,
ProfileProperties defaultProfile,
io.reactivex.functions.Consumer<AccountInfo> onSuccess,
io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Sign up with email and password.
This job will be scheduled to run in IO thread pool ( Schedulers.io() ), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread. |
public static void init(android.content.Context context)
LoginKit
instance, your api token must be placed in AndroidManifest.xml
inside < application> tag like this
<meta-data android:name="USER_KIT_API_TOKEN" android:value="your_api_token_here" />
context
- application context. init(Context, String)
public static void init(android.content.Context context, java.lang.String apiToken)
LoginKit
instance with an api token.context
- application context.apiToken
- userkit api token.public static LoginKit getInstance()
LoginKit
singleton instance.java.lang.IllegalStateException
- if LoginKit has not been initialized.public static AccountManager getAccountManager()
AccountManager
instance.AccountManager
instance.@Deprecated public void getAffiliates(Action1<java.util.List<Affiliate>> onResponse, Action1<java.lang.Throwable> onError)
getAffiliates()
, getAffiliates(Consumer)
,
getAffiliates(Consumer, Consumer)
instead.public void getAffiliates(Action1<java.util.List<Affiliate>> onResponse)
getAffiliates()
, getAffiliates(Consumer)
,
getAffiliates(Consumer, Consumer)
instead.public void affiliateSignUp(java.lang.String name, java.lang.String email, java.lang.String password, java.lang.String token, Action1<LoginResponse> onResponse, Action1<java.lang.Throwable> onError)
public void affiliateSignUp(java.lang.String name, java.lang.String email, java.lang.String password, java.lang.String token, Action1<LoginResponse> onResponse)
@Deprecated public void signUpNewProfile(java.lang.String email, java.lang.String password, AccountProfileProperties defaultProfile, LoginCallback loginCallback)
@Deprecated public void signUpNewProfile(java.lang.String email, java.lang.String password, AccountProfileProperties defaultProfile, boolean loginOnSuccess, LoginCallback loginCallback)
@Deprecated public void loginFacebookAccount(java.lang.String facebookToken, LoginCallback loginCallback)
loginFacebookAccount(String)
,
loginFacebookAccount(String, Consumer)
, loginFacebookAccount(String, Consumer, Consumer)
instead.@Deprecated public void loginGooglePlusAccount(java.lang.String googlePlusToken, LoginCallback loginCallback)
@Deprecated public void resetPassword(java.lang.String email, ResetPasswordCallback callback)
resetPassword(String)
, resetPassword(String, Action)
,
resetPassword(String, Action, Consumer)
instead.public io.reactivex.Single<java.util.List<Affiliate>> getAffiliates()
Affiliate
list if success.public void getAffiliates(io.reactivex.functions.Consumer<java.util.List<Affiliate>> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
onSuccess
- The callback on success.getAffiliates()
public void getAffiliates(io.reactivex.functions.Consumer<java.util.List<Affiliate>> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
onSuccess
- The callback on success.onError
- The callback on error.getAffiliates()
public io.reactivex.Single<AccountInfo> affiliateSignUp(java.lang.String name, java.lang.String email, java.lang.String password, java.lang.String token)
name
- Display name.email
- Email.password
- Password.token
- The OAuth token returned by OAuthWebView
.AccountInfo
of user if success.public void affiliateSignUp(java.lang.String name, java.lang.String email, java.lang.String password, java.lang.String token, io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
name
- Display name.email
- Email.password
- Password.token
- The OAuth token returned by OAuthWebView
.onSuccess
- The callback onSuccess.affiliateSignUp(String, String, String, String)
public void affiliateSignUp(java.lang.String name, java.lang.String email, java.lang.String password, java.lang.String token, io.reactivex.functions.Consumer<AccountInfo> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
name
- Display name.email
- Email.password
- Password.token
- The OAuth token returned by OAuthWebView
.onSuccess
- The callback onSuccess.onError
- The callback onError.affiliateSignUp(String, String, String, String)
public io.reactivex.Single<AccountInfo> signUpNewProfile(java.lang.String email, java.lang.String password, boolean loginOnSuccess, @Nullable ProfileProperties defaultProfile)
email
- Email.password
- Password.loginOnSuccess
- if true, after sign up success,
AccountManager
will store the credential of this account and
AccountManager.isLoggedIn()
will also return true.defaultProfile
- Default profile for new account, can be null.
Use ImmutableProfileProperties
to create an instance.AccountInfo
if create account success.public void signUpNewProfile(java.lang.String email, java.lang.String password, boolean loginOnSuccess, @Nullable ProfileProperties defaultProfile, io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
email
- Email.password
- Password.loginOnSuccess
- if true, after sign up success,
AccountManager
will store the credential of this account and
AccountManager.isLoggedIn()
will also return true.defaultProfile
- Default profile for new account, can be null.
Use ImmutableProfileProperties
to create an instance.onSuccess
- The callback on success.ImmutableProfileProperties
,
signUpNewProfile(String, String, boolean, ProfileProperties)
public void signUpNewProfile(java.lang.String email, java.lang.String password, boolean loginOnSuccess, @Nullable ProfileProperties defaultProfile, io.reactivex.functions.Consumer<AccountInfo> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
email
- Email.password
- Password.loginOnSuccess
- if true, after sign up success,
AccountManager
will store the credential of this account and
AccountManager.isLoggedIn()
will also return true.defaultProfile
- Default profile for new account, can be null.
Use ImmutableProfileProperties
to create an instance.onSuccess
- The callback on success.onError
- The callback on error.ImmutableProfileProperties
,
signUpNewProfile(String, String, boolean, ProfileProperties)
@Deprecated public void loginWithEmailAndPassword(java.lang.String email, java.lang.String password, LoginCallback loginCallback)
public io.reactivex.Single<AccountInfo> loginWithEmailAndPassword(java.lang.String email, java.lang.String password)
email
- Email.password
- Password.AccountInfo
if login success.public void loginWithEmailAndPassword(java.lang.String email, java.lang.String password, io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
email
- Email.password
- Password.onSuccess
- The callback on success.loginWithEmailAndPassword(String, String)
public void loginWithEmailAndPassword(java.lang.String email, java.lang.String password, io.reactivex.functions.Consumer<AccountInfo> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
email
- Email.password
- Password.onSuccess
- The callback on success.onError
- The callback on error.loginWithEmailAndPassword(String, String)
public io.reactivex.Single<AccountInfo> loginFacebookAccount(java.lang.String facebookToken)
facebookToken
- Facebook token.AccountInfo
if login success.public void loginFacebookAccount(java.lang.String facebookToken, io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
facebookToken
- Facebook token.onSuccess
- The callback on success.loginFacebookAccount(String)
public void loginFacebookAccount(java.lang.String facebookToken, io.reactivex.functions.Consumer<AccountInfo> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
facebookToken
- Facebook token.onSuccess
- The callback on success.onError
- The callback on error.loginFacebookAccount(String)
public io.reactivex.Single<AccountInfo> loginGooglePlusAccount(java.lang.String googlePlusToken)
googlePlusToken
- Google+ token.AccountInfo
if login success.public void loginGooglePlusAccount(java.lang.String googlePlusToken, io.reactivex.functions.Consumer<AccountInfo> onSuccess)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
googlePlusToken
- Google+ token.onSuccess
- The callback on success.(String)
public void loginGooglePlusAccount(java.lang.String googlePlusToken, io.reactivex.functions.Consumer<AccountInfo> onSuccess, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
googlePlusToken
- Google+ token.onSuccess
- The callback on success.onError
- The callback on error.(String)
public io.reactivex.Completable resetPassword(java.lang.String email)
email
- Email.public void resetPassword(java.lang.String email, io.reactivex.functions.Action onComplete)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
email
- Email.onComplete
- The callback on complete reset password.resetPassword(String)
public void resetPassword(java.lang.String email, io.reactivex.functions.Action onComplete, io.reactivex.functions.Consumer<java.lang.Throwable> onError)
Schedulers.io()
), and
will try to call back the consumer - `onSuccess` in the current thread which call this method,
if can't, onSuccess will call back on main thread.
email
- Email.onComplete
- The callback on complete reset password.onError
- The callback on reset password error.resetPassword(String)