Set Client State Change listener
Set your own ClientStateChangeListener to get optional callbacks.
Method name:
Client.setOnClientStateChangeListener(listener);
Declaration:
public static void setOnClientStateChangeListener(OnClientStateChangeListener listener)
fun setOnClientStateChangeListener(listener:OnClientStateChangeListener)
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| listener | OnClientStateChangeListener | yes | - | interface to handle client state change |
Return Value:
No value is returned.
Example:
Client.setOnClientStateChangeListener(listener);
Client.setOnClientStateChangeListener(listener)
Remove Client State Change listener
Remove your own ClientStateChangeListener.
Method name:
Client.removeClientStateChangeListener();
Declaration:
public static void removeClientStateChangeListener()
fun removeClientStateChangeListener()
Parameters:
No parameters required.
Return Value:
No value is returned.
Example:
Client.removeClientStateChangeListener();
Client.removeClientStateChangeListener()
Register customer account
This method registers a new customer with an email, password, and optional data.
This method requires the context object with a customer’s email, password, and optional data. Omitted fields are not modified.
Depending on the backend configuration, the account may require activation. For details, see customer registration.
Do not allow signing in again (or signing up) when a customer is already signed in. Sign the customer out first.
Do not create multiple instances nor call this method multiple times before execution.
This method is a global operation and doesn't require customer authentication.
The API key must have the SAUTH_REGISTER_CLIENT_CREATE permission from the Client group.
Method name:
Client.registerAccount(registerClient)
Declaration:
public static IApiCall registerAccount(@NonNull RegisterClient registerClient)
fun registerAccount(registerClient: RegisterClient): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default |
|---|---|---|---|
| registerClient | RegisterClient | yes | - |
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall signUpCall;
private void signUp(RegisterClient registerClient) {
if (signUpCall != null) signUpCall.cancel();
signUpCall = Client.registerAccount(registerClient);
signUpCall.onSubscribe(() -> toggleLoading(true))
.doFinally(() -> toggleLoading(false))
.execute(this::onSignUpSuccessful, this::onSignUpFailure);
}
private var signUpCall: IApiCall
private fun signUp(registerClient: RegisterClient) {
signUpCall!!.cancel()
signUpCall = Client.registerAccount(registerClient)
signUpCall!!.onSubscribe({ toggleLoading(true) })
.doFinally({ toggleLoading(false) })
.execute(({ this.onSignUpSuccessful() }), ({ this.onSignUpFailure() }))
}
Request customer account activation
This method requests sending an email with a URL that confirms the registration and activates the account.
This method is a global operation and doesn't require customer authentication.
The API key must have the SAUTH_CONFIRMATION_CLIENT_CREATE permission from the Client group.
Method name:
Client.requestAccountActivation(email)
Declaration:
public static IApiCall requestAccountActivation(String email)
fun requestAccountActivation(email: String): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| String | yes | - | Customer's email |
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall call;
if (call != null) call.cancel();
call = Client.requestAccountActivation(email);
call.execute(this::onSuccess, this::onError);
private val call: IApiCall? = null
call.cancel();
call = Client.requestAccountActivation(email);
call.execute(this::onSuccess, this::onError);
Confirm customer account activation
This method confirms a customer account with the confirmation token.
This method is a global operation and doesn't require customer authentication.
Returns the HTTP 400 status code if the account is already confirmed or 404 if the account does not exist.
The API key must have the SAUTH_CONFIRMATION_CLIENT_CREATE permission from the Client group.
Method name:
Client.confirmAccountActivation(token)
Declaration:
public static IApiCall confirmAccountActivation(String token)
fun confirmAccountActivation(token: String): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| token | String | yes | - | Customer's token |
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall call;
if (call != null) call.cancel();
call = Client.confirmAccountActivation(token);
call.execute(this::onSuccess, this::onError);
private val call: IApiCall? = null
call.cancel();
call = Client.confirmAccountActivation(token);
call.execute(this::onSuccess, this::onError);
Request customer account activation by pin
This method requests a customer's account registration process with the PIN code.
This method is a global operation and doesn't require customer authentication.
The API key must have the SAUTH_PIN_CODE_RESEND_CLIENT_CREATE permission from the Client group.
Method name:
Client.requestAccountActivationByPin(email)
Declaration:
public static IApiCall requestAccountActivationByPin(String email)
fun requestAccountActivationByPin(email:String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| String | yes | - | Email to which the pinCode will be sent |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall apiCall;
apiCall = Client.requestAccountActivationByPin(email);
apiCall.execute(this::onSuccess, this::onFailure);
val apiCall:IApiCall
apiCall = Client.requestAccountActivationByPin(email)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Confirm customer account activation by pin
This method confirms a customer's account registration process with the PIN code.
This method is a global operation and doesn't require customer authentication.
The API key must have the SAUTH_PIN_CODE_RESEND_CLIENT_CREATE permission from the Client group.
Method name:
Client.confirmAccountActivationByPin(pinCode, email)
Declaration:
public static IApiCall confirmAccountActivationByPin(String pinCode, String email)
fun confirmAccountActivationByPin(pinCode: String, email:String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| pinCode | String | yes | - | Code sent to the customer's email |
| String | yes | - | Email used in the registration process |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall apiCall;
apiCall = Client.confirmAccountActivationByPin(pinCode, email);
apiCall.execute(this::onSuccess, this::onFailure);
val apiCall:IApiCall
apiCall = Client.confirmAccountActivationByPin(pinCode, email)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Sign in a customer
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
The SDK will refresh the token before each call if it is about to expire (but not expired).
Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.
Do NOT create multiple instances nor call this method multiple times before execution.
Method name:
Client.signIn(email, password)
Declaration:
public static IApiCall signIn(@NonNull String email, @NonNull String password)
fun signIn(email: String, password: String): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| String | yes | - | Customer's email | |
| password | String | yes | - | Customer's password |
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall signInCall;
private void signIn(String login, String password) {
if (signInCall != null) signInCall.cancel();
signInCall = Client.signIn(login, password);
signInCall.onSubscribe(() -> toggleLoading(true))
.execute(() -> onSignInSuccessful(login), () -> onSignInFailure());
}
private var signInCall: IApiCall
private fun signIn(login: String, password: String) {
signInCall!!.cancel()
signInCall = Client.signIn(login, password)
signInCall!!.onSubscribe({ toggleLoading(true) })
.execute({ onSignInSuccessful(login) }, { onSignInFailure() })
}
Sign in a customer conditionally
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
The SDK will refresh the token before each call if it is about to expire (but not expired).
Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.
Do NOT create multiple instances nor call this method multiple times before execution.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| Method name: | ||||
| Client.signInConditionally(email, password) |
Declaration:
public static IDataApiCall<AuthConditions> signInConditionally(@NonNull String email, @NonNull String password)
fun signInConditionally(
email: String,
password: String,
): IDataApiCall<AuthConditions>
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| String | yes | - | Client's email | |
| password | String | yes | - | Client's password |
Return Value:
IDataApiCall<AuthConditions> object to execute the request.
Example:
private IDataApiCall<AuthConditions> call;
if (call != null) call.cancel();
call = Client.signInConditionally(email, password));
call.execute(this::onSuccess, this::onFailure);
val call:IDataApiCall<AuthConditions>
call.cancel()
call = Client.signInConditionally(email, password)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Authenticate customer by IdentityProvider
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
If an account for the customer does not exist and the identity provider is different than Synerise, this request creates an account.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.7.6 | 3.8.0 | 0.9.19 | 0.3.0 |
| Method name: | ||||
| Client.authenticate(token, clientIdentityProvider, agreements, attributes, authId) |
Declaration:
public static IApiCall authenticate(String token, ClientIdentityProvider provider, Agreements agreements, Attributes attributes, String authId)
fun authenticate(
token: String,
provider: ClientIdentityProvider,
agreements: Agreements?,
attributes: Attributes?,
authId: String?
): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| token | String | yes | - | Token retrieved from provider |
| provider | ClientIdentityProvider | yes | - | Provider of your token |
| agreements | Agreements | no | - | Optional agreements |
| attributes | Attributes | no | - | Optional attributes |
| authId | String | no | - | Optional identifier of authorization |
authId parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall call;
if (call != null) call.cancel();
call = Client.authenticate(token, provider, null, null, null);
call.execute(this::onSuccess, this::onFailure);
val call:IApiCall
call.cancel()
call = Client.authenticate(token, provider, null, null, null)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Authenticate customer conditionally by IdentityProvider
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| Method name: | ||||
| Client.authenticateConditionally(token, clientIdentityProvider, agreements, attributes, authId) |
Declaration:
public static IDataApiCall<AuthConditions> authenticateConditionally(@NonNull String token, @NonNull ClientIdentityProvider provider, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
fun authenticateConditionally(
token: String,
provider: ClientIdentityProvider,
agreements: Agreements?,
attributes: Attributes?,
authId: String?
): IDataApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| token | String | yes | - | Token retrieved from provider |
| provider | ClientIdentityProvider | yes | - | Provider of your token |
| agreements | Agreements | no | - | Optional agreements |
| attributes | Attributes | no | - | Optional attributes |
| authId | String | no | - | Optional identifier of authorization |
authId parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.
Return Value:
IDataApiCall<AuthConditions> object to execute the request.
Example:
private IDataApiCall<AuthConditions> call;
if (call != null) call.cancel();
call = Client.authenticateConditionally(token, clientIdentityProvider, agreements, attributes, authId));
call.execute(this::onSuccess, this::onFailure);
val call:IDataApiCall<AuthConditions>
call.cancel()
call = Client.authenticateConditionally(token, clientIdentityProvider, agreements, attributes, authId)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Authenticate customer with token payload
This method signs in a customer in with the provided token payload.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.15.0 | 5.15.0 | n/a | n/a |
| Method name: | ||||
| Client.authenticateWithTokenPayload() |
Declaration:
public static IApiCall authenticateWithTokenPayload(TokenPayload tokenPayload, @NonNull String authId)
fun authenticateWithTokenPayload(
tokenPayload: TokenPayload,
authId: String
): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| tokenPayload | TokenPayload | yes | - | Object which contains a token's payload |
| authId | String | yes | - | Required customer's identifier of authorization |
authId parameter is used for decreasion the number of UUID refreshes so it must be unique for every customer.
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall call;
if (call != null) call.cancel();
call = Client.authenticateWithTokenPayload(tokenPayload, authId);
call.execute(this::onSuccess, this::onFailure);
val call:IApiCall
call.cancel()
call = Client.authenticateWithTokenPayload(tokenPayload, authId)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Authenticate customer via Simple Profile Authentication
This method authenticates a customer with Simple Profile Authentication.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.14.0 | 5.7.1 | 0.15.0 | 0.7.0 |
When you use this method, you must set a request validation salt by using the Synerise.setRequestValidationSalt(_:) method (if salt is enabled for Simple Profile Authentication).
The API key must have the SAUTH_SIMPLE_AUTH_CREATE from the Auth group.
Method name:
Client.simpleAuthentication(clientData, authId)
Declaration:
public static IApiCall simpleAuthentication(ClientData clientData, String authId)
fun simpleAuthentication(
clientData: ClientData,
authId: String
): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| clientData | ClientData | yes | - | Object which contains customer data |
| authId | String | yes | - | Required identifier of authorization |
authId parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.
Return Value:
IApiCall object to execute the request.
Check if a customer is signed in (via RaaS, OAuth, Facebook, Apple)
This method checks if a customer is signed in (via Synerise Authentication - RaaS, OAuth, Facebook, Apple).
Method name:
Client.isSignedIn()
Declaration:
public static boolean isSignedIn()
fun isSignedIn():Boolean
Parameters:
No parameters.
Return Value:
Boolean defining whether a customer is signed in or not.
Example:
boolean isSignedIn = Client.isSignedIn()
var isSignedIn = Client.isSignedIn()
Check if a customer is signed in (via Simple Profile Authentication)
This method checks if a customer is signed in (via Simple Profile Authentication).
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.14.0 | 5.7.1 | 0.15.0 | 0.7.0 |
| Method name: | ||||
| Client.isSignedIn() |
Declaration:
public static boolean isSignedInViaSimpleAuthentication()
fun isSignedInViaSimpleAuthentication():Boolean
Parameters:
No parameters.
Return Value:
true if the customer is signed in (via Simple Profile Authentication), otherwise returns false.
Example:
boolean isSignedInViaSimpleAuthentication = Client.isSignedInViaSimpleAuthentication()
var isSignedInViaSimpleAuthentication = Client.isSignedInViaSimpleAuthentication()
Sign out customer
This method signs out a customer out.
This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).
Method name:
Client.signOut()
Declaration:
public static void signOut()
fun signOut()
Parameters:
No parameters.
Return Value:
Nothing is returned.
Example:
Client.signOut();
Client.signOut();
Sign out customer with mode or from all devices
This method signs out a customer out with a chosen mode and Determines if the method should sign out all devices.
Available modes:
.signOutmode signs out the customer..signOutWithSessionDestroymode signs out the customer and additionally, clears the anonymous session and regenerates the customer UUID.
The fromAllDevices parameter determines whether the method should notify the backend to sign out all devices.
IMPORTANT: It is an asynchronous method.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.11.0 | 5.1.0 | 0.14.0 | 1.0.0 |
This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).
Class:
Client
Declaration:
public static IApiCall signOut(ClientSignOutMode mode, Boolean signOutFromAllDevices)
fun signOut(mode: ClientSignOutMode, signOutFromAllDevices: Boolean): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| mode | ClientSignOutMode | yes | - | Client sign out mode |
| signOutFromAllDevices | Boolean | yes | - | Determines if the method should sign out all devices |
Return Value:
Nothing is returned.
Example:
private IApiCall signOutCall;
private void signOut() {
if (signOutCall != null) signOutCall.cancel();
signOutCall = Client.signOut(ClientSignOutMode.SIGN_OUT_WITH_SESSION_CLEARING, true);
signOutCall.onSubscribe(() -> toggleLoading(true))
.execute(() -> onSignOutSuccessful(login), () -> onSignOutFailure());
}
private var signOutCall: IApiCall
private fun signOut(login: String, password: String) {
signOutCall!!.cancel()
signOutCall = Client.signOut(.SIGN_OUT_WITH_SESSION_CLEARING, true)
signOutCall!!.onSubscribe({ toggleLoading(true) })
.execute({ onSignOutSuccessful(login) }, { onSignOutFailure() })
}
Removed methods
Authenticate customer by OAuth with registration
This method authenticates a customer with OAuth.
If an account for the customer does not exist, this request creates an account.
| Available on | iOS SDK | Android SDK | React Native SDK | Flutter SDK |
|---|---|---|---|---|
| Introduced in: | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| Deprecated in: | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | 1.0.0 | n/a |
Returns the HTTP 401 status code if the provided access token and/or API Key is invalid.
Method name:
Client.authenticateByOAuth(accessToken, agreements, attributes, authId)
Declaration:
public static IApiCall authenticateByOAuth(@NonNull String accessToken, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
fun authenticateByOAuth(
accessToken: String,
agreements: Agreements?,
attributes: Attributes?,
authId: String?
): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| accessToken | String | yes | - | OAuth Access Token |
| agreements | Agreements | no | --- | Optional agreements |
| attributes | Attributes | no | --- | Optional attributes |
| authId | String | no | --- | Optional identifier of authorization |
authId parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall call;
if (call != null) call.cancel();
call = Client.authenticateByOAuth(token, null, null, null);
call.execute(this::onSuccess, this::onFailure);
val call:IApiCall
call.cancel()
call = Client.authenticateByOAuth(token, null, null, null)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Authenticate customer by OAuth without registration
This method authenticates a customer with OAuth.
| Available on | iOS SDK | Android SDK | React Native SDK | Flutter SDK |
|---|---|---|---|---|
| Introduced in: | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| Deprecated in: | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | 1.0.0 | n/a |
Returns the HTTP 401 status code if the provided access token and/or API Key is invalid.
Method name:
Client.authenticateByOAuthIfRegistered(accessToken, authId)
Declaration:
public static IApiCall authenticateByOAuthIfRegistered(@NonNull String accessToken, @Nullable String authId)
fun authenticateByOAuthIfRegistered(
accessToken: String,
authId: String?
): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| accessToken | String | yes | - | OAuth Access Token |
| authId | String | no | --- | Optional identifier of authorization |
authId parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall call;
if (call != null) call.cancel();
call = Client.authenticateByOAuthIfRegistered(token, null);
call.execute(this::onSuccess, this::onFailure);
val call:IApiCall
call.cancel()
call = Client.authenticateByOAuthIfRegistered(token, null)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Authenticate customer by Facebook with registration
This method authenticates a customer with Facebook.
If an account for the customer does not exist, this request creates an account.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.3.8 | 3.3.0 | 0.9.7 | n/a |
| Deprecated in: | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | 1.0.0 | n/a |
Returns the HTTP 401 status code if the provided Facebook token and/or API Key is invalid.
Method name:
Client.authenticateByFacebook(facebookToken, agreements, attributes, authId)
Declaration:
public static IApiCall authenticateByFacebook(@NonNull String facebookToken, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
fun authenticateByFacebook(
facebookToken: String,
agreements: Agreements?,
attributes: Attributes?,
authId: String?
): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| facebookToken | String | yes | - | Facebook Access Token |
| agreements | Agreements | no | --- | Marketing agreements |
| attributes | Attributes | no | --- | Additional attributes |
| authId | String | no | --- | Optional identifier of authorization |
authId parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall signInFacebookCall;
private void signInFacebook(String facebookToken) {
if (signInFacebookCall != null) signInFacebookCall.cancel();
signInFacebookCall = Client.authenticateByFacebook(facebookToken, null, null, null);
signInFacebookCall.onSubscribe(() -> toggleFacebookLoading(true))
.execute(this::onSignInFacebookSuccess, this::onSignInFacebookError);
}
private var signInFacebookCall: IApiCall? = null
private fun signInFacebook(facebookToken: String) {
if (signInFacebookCall != null) signInFacebookCall!!.cancel()
signInFacebookCall = Client.authenticateByFacebook(facebookToken, null, null, null)
signInFacebookCall!!.onSubscribe({ toggleFacebookLoading(true) })
.execute(({ this.onSignInFacebookSuccess() }), ({ this.onSignInFacebookError() }))
}
Authenticate customer by Facebook without registration
This method authenticates a customer with Facebook.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.3.8 | 3.3.0 | 0.9.7 | n/a |
| Deprecated in: | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | 1.0.0 | n/a |
Returns the HTTP 401 status code if the provided Facebook token and/or API Key is invalid.
Method name:
Client.authenticateByFacebookRegistered(facebookToken, authId)
Declaration:
public static IApiCall authenticateByFacebookRegistered(@NonNull String facebookToken, @Nullable String authId)
fun authenticateByFacebookRegistered(facebookToken: String, authId: String?): IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| facebookToken | String | yes | - | Facebook Access Token |
| authId | String | no | --- | Optional identifier of authorization |
authId parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall signInFacebookRegisteredCall;
private void signInFacebookRegistered(String facebookToken) {
if (signInFacebookRegisteredCall != null) signInFacebookRegisteredCall.cancel();
signInFacebookRegisteredCall = Client.authenticateByFacebookRegistered(facebookToken, null);
signInFacebookRegisteredCall.onSubscribe(() -> toggleFacebookLoading(true))
.execute(this::onSignInFacebookSuccess, this::onSignInFacebookError);
}
private var signInFacebookRegisteredCall: IApiCall? = null
private fun signInFacebook(facebookToken: String) {
signInFacebookRegisteredCall!!.cancel()
signInFacebookRegisteredCall = Client.authenticateByFacebookRegistered(facebookToken, null)
signInFacebookRegisteredCall!!.onSubscribe({ toggleFacebookLoading(true) })
.execute(({ this.onSignInFacebookSuccess() }), ({ this.onSignInFacebookError() }))
}
Sign out customer with mode
This method signs out a customer out with a chosen mode:
.signOutmode notifies the backend that the customer is signed out..signOutWithSessionDestroymode notifies the backend that the customer is signed out and additionally, clears the anonymous session and regenerates the customer UUID.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.4.0 | 4.6.0 | 0.12.0 | 0.7.0 |
| Deprecated in: | 4.11.0 | 5.1.0 | - | - |
| Removed in: | 5.0.0 | 6.0.0 | 0.14.0 | 1.0.0 |
This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).
Class:
Client
Declaration:
public static void signOut(ClientSignOutMode mode)
fun signOut()
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| mode | ClientSignOutMode | yes | - | Client sign out mode |
Return Value:
Nothing is returned.
Example:
Client.signOut(mode);
Client.signOut(mode);