public class Account
An account represents a user. By using this resource, you can create consumer accounts, update data for a specific customer, (de)activate your account and so on.
Modifier and Type | Method and Description |
---|---|
void |
authenticate(java.lang.String username,
java.lang.String password,
InPlayerCallback<com.sdk.inplayer.model.account.InPlayerAuthorizationModel,com.sdk.inplayer.model.error.InPlayerException> callback)
Authenticates an account by creating an access token that can be used for future requests.
|
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword,
java.lang.String newPasswordConfirmation,
InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Replaces the account's password with a new one.
|
void |
deleteAccount(java.lang.String password,
InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Erases an account (and all the data associated) permanently.
|
void |
exportData(java.lang.String password,
InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Exports account data such as logins, payments, subscriptions, access to assets etc.
After invoking the request the account will receive the data in a json format via e-mail.
|
void |
getAccount(InPlayerCallback<com.sdk.inplayer.model.account.InPlayerUser,com.sdk.inplayer.model.error.InPlayerException> callback)
Returns all the relevant information about an account.
|
InPlayerUser |
getAccountInfo()
Return the authenticated user
|
InPlayerCredentials |
getCredentials()
Get user credentials.
|
void |
getRegisterFields(InPlayerCallback<java.util.List,com.sdk.inplayer.model.error.InPlayerException> callback) |
void |
getSocialLoginUrls(java.lang.String redirectUri,
InPlayerCallback<java.util.ArrayList,com.sdk.inplayer.model.error.InPlayerException> callback)
Gets the social login urls for fb/twitter/google
|
boolean |
isAuthenticated()
Check's if the user is authenticated
|
void |
refreshToken(java.lang.String refreshToken,
InPlayerCallback<com.sdk.inplayer.model.account.InPlayerAuthorizationModel,com.sdk.inplayer.model.error.InPlayerException> callback)
Refreshes account using refreshToken
|
void |
requestNewPassword(java.lang.String email,
InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Provides you with a token for resetting your password via email.
|
void |
sendPinCode(InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Creates pin code and sends it to your email
|
void |
sendPinCode(java.lang.String brandingId,
InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback) |
void |
setNewPassword(java.lang.String token,
java.lang.String newPassword,
java.lang.String newPasswordConfirmation,
InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Updates your password by using the previously provided forgot password token.
|
void |
signOut(InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Logs the account out.
|
void |
signUp(java.lang.String fullName,
java.lang.String email,
java.lang.String password,
java.lang.String passwordConfirmation,
InPlayerCallback<com.sdk.inplayer.model.account.InPlayerAuthorizationModel,com.sdk.inplayer.model.error.InPlayerException> callback)
Registers a new InPlayer account.
|
void |
signUp(java.lang.String fullName,
java.lang.String email,
java.lang.String password,
java.lang.String passwordConfirmation,
java.util.HashMap<java.lang.String,java.lang.String> metadata,
InPlayerCallback<com.sdk.inplayer.model.account.InPlayerAuthorizationModel,com.sdk.inplayer.model.error.InPlayerException> callback)
Registers a new InPlayer account.
|
void |
updateAccount(java.lang.String fullName,
java.util.HashMap<java.lang.String,java.lang.String> metadata,
InPlayerCallback<com.sdk.inplayer.model.account.InPlayerUser,com.sdk.inplayer.model.error.InPlayerException> callback)
Updates an account
|
void |
validatePinCode(java.lang.String pinCode,
InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Checks validity of pin code
|
void |
validateSocialLoginToken(android.net.Uri tokenUri,
InPlayerCallback<com.sdk.inplayer.model.account.InPlayerUser,com.sdk.inplayer.model.error.InPlayerException> callback)
Validate the tokens retrived from the Redirect after successfull Social authentication
|
@NotNull public InPlayerCredentials getCredentials()
Get user credentials.
Returns: User credentials. (Optional)
public boolean isAuthenticated()
Check's if the user is authenticated
@Nullable public InPlayerUser getAccountInfo()
Return the authenticated user
public void signUp(@NotNull java.lang.String fullName, @NotNull java.lang.String email, @NotNull java.lang.String password, @NotNull java.lang.String passwordConfirmation, @NotNull InPlayerCallback<com.sdk.inplayer.model.account.InPlayerAuthorizationModel,com.sdk.inplayer.model.error.InPlayerException> callback)
Registers a new InPlayer account.
fullName
- String Account's first and last nameemail
- String Account’s email addresspassword
- String Password containing minimum 8 characterspasswordConfirmation
- String The same password with minimum 8 characterscallback
- InPlayerCallbackpublic void signUp(@NotNull java.lang.String fullName, @NotNull java.lang.String email, @NotNull java.lang.String password, @NotNull java.lang.String passwordConfirmation, @Nullable java.util.HashMap<java.lang.String,java.lang.String> metadata, @NotNull InPlayerCallback<com.sdk.inplayer.model.account.InPlayerAuthorizationModel,com.sdk.inplayer.model.error.InPlayerException> callback)
Registers a new InPlayer account.
fullName
- String Account's first and last nameemail
- String Account’s email addresspassword
- String Password containing minimum 8 characterspasswordConfirmation
- String The same password with minimum 8 charactersmetadata
- HashMapcallback
- InPlayerCallback<{@code InPlayerAuthorizationModel}, {@code InPlayerException}>public void getAccount(@NotNull InPlayerCallback<com.sdk.inplayer.model.account.InPlayerUser,com.sdk.inplayer.model.error.InPlayerException> callback)
Returns all the relevant information about an account.
callback
- InPlayerCallbackpublic void exportData(@NotNull java.lang.String password, @NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Exports account data such as logins, payments, subscriptions, access to assets etc. After invoking the request the account will receive the data in a json format via e-mail.
password
- of the current logged userpublic void getRegisterFields(@NotNull InPlayerCallback<java.util.List,com.sdk.inplayer.model.error.InPlayerException> callback)
public void authenticate(@NotNull java.lang.String username, @NotNull java.lang.String password, @NotNull InPlayerCallback<com.sdk.inplayer.model.account.InPlayerAuthorizationModel,com.sdk.inplayer.model.error.InPlayerException> callback)
Authenticates an account by creating an access token that can be used for future requests.
username
- String The email address of the accountpassword
- String The account passwordcallback
- InPlayerCallbackpublic void signOut(@NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Logs the account out.
callback
- InPlayerCallbackpublic void updateAccount(@NotNull java.lang.String fullName, @Nullable java.util.HashMap<java.lang.String,java.lang.String> metadata, @NotNull InPlayerCallback<com.sdk.inplayer.model.account.InPlayerUser,com.sdk.inplayer.model.error.InPlayerException> callback)
Updates an account
fullName
- String The full name of the accountmetadata
- HashMapcallback
- InPlayerCallbackpublic void changePassword(@NotNull java.lang.String oldPassword, @NotNull java.lang.String newPassword, @NotNull java.lang.String newPasswordConfirmation, @NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Replaces the account's password with a new one.
oldPassword
- String Account's old passwordnewPassword
- String The account's new passwordnewPasswordConfirmation
- String The account's new password for confirmation.callback
- InPlayerCallbackpublic void refreshToken(@NotNull java.lang.String refreshToken, @NotNull InPlayerCallback<com.sdk.inplayer.model.account.InPlayerAuthorizationModel,com.sdk.inplayer.model.error.InPlayerException> callback)
Refreshes account using refreshToken
refreshToken
- String An auto-generated token that enables access when the original access token has expired withoutrequiring re authenticationcallback
- InPlayerCallbackpublic void requestNewPassword(@NotNull java.lang.String email, @NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Provides you with a token for resetting your password via email.
email
- String Account’s email addresscallback
- InPlayerCallbackpublic void deleteAccount(@NotNull java.lang.String password, @NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Erases an account (and all the data associated) permanently.
password
- String Password confirmationcallback
- InPlayerCallbackpublic void setNewPassword(@NotNull java.lang.String token, @NotNull java.lang.String newPassword, @NotNull java.lang.String newPasswordConfirmation, @NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Updates your password by using the previously provided forgot password token.
token
- String The forgot password token sent to your email addressnewPassword
- String The account’s new passwordnewPasswordConfirmation
- String The password confirmationcallback
- InPlayerCallbackpublic void getSocialLoginUrls(@NotNull java.lang.String redirectUri, @NotNull InPlayerCallback<java.util.ArrayList,com.sdk.inplayer.model.error.InPlayerException> callback)
Gets the social login urls for fb/twitter/google
callback
- InPlayerCallbackpublic void validateSocialLoginToken(@NotNull android.net.Uri tokenUri, @NotNull InPlayerCallback<com.sdk.inplayer.model.account.InPlayerUser,com.sdk.inplayer.model.error.InPlayerException> callback)
Validate the tokens retrived from the Redirect after successfull Social authentication
tokenUri
- : Uri The Uri containing the Token and Refresh token, retried from intent datacallback
- : InPlayerCallbackpublic void validatePinCode(@NotNull java.lang.String pinCode, @NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Checks validity of pin code
pinCode
- : The pin code that was sent to your emailcallback
- : InPlayerCallbackpublic void sendPinCode(@NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)
Creates pin code and sends it to your email
callback
- : InPlayerCallbackpublic void sendPinCode(@Nullable java.lang.String brandingId, @NotNull InPlayerCallback<java.lang.String,com.sdk.inplayer.model.error.InPlayerException> callback)