Refresh customer token
This method refreshes the customer’s current token.
Returns an error if the token has expired and cannot be refreshed.
Method name:
Client.refreshToken()
Declaration:
public static IApiCall refreshToken()
fun refreshToken():IApiCall
Parameters:
No parameters required.
Return Value:
IApiCall object to execute the request.
Example:
boolean success = Client.refreshToken();
var success = Client.refreshToken()
Retrieve customer token
This method retrieves the customer’s current, active token.
Returns an error if the token has expired and cannot be retrieved.
Method name:
Client.retrieveToken()
This method replaces Client.getToken().
Declaration:
public static IDataApiCall<Token> retrieveToken()
fun retrieveToken():IDataApiCall<Token>
Parameters:
No parameters required.
Return Value:
IDataApiCall<Token> object to execute the request.
Example:
IDataApiCall retrieveTokenCall = Client.retrieveToken();
retrieveTokenCall.execute(success -> onSuccess(), this::onFailure);
val retrieveTokenCall = Client.retrieveToken()
retrieveTokenCall.execute({ success-> onSuccess() }, ({ this.onFailure() }))
Get current customer UUID
This method retrieves the customer’s current UUID.
Method name:
Client.getUuid()
Declaration:
public static String getUuid()
fun getUuid():String
Parameters:
No parameters required.
Return Value:
Customer's UUID as a string.
Example:
Client.getUuid()
Client.getUuid()
Get customer UUID for use in authentication
This method retrieves the current UUID or generates a new one from a seed.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.15.0 | 5.15.0 | n/a | n/a |
This operation doesn't affect the customer session in the SDK.
Method name:
Client.getUuidForAuthentication()
Declaration:
public static String getUuidForAuthentication(@NonNull String authId)
fun getUuidForAuthentication(
authId: String
): String
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| authId | String | yes | --- | Seed for UUID generation |
Return Value:
The UUID for use in authentication as a string.
Example:
Client.getUuidForAuthentication(authId)
Client.getUuidForAuthentication(authId)
Regenerate customer
This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.
This operation works only if the customer is anonymous.
This operation clears the authentication token, login (if applicable), custom email, and custom identifier.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.3.10 | 3.3.5 | 0.9.0 | 0.7.0 |
| Method name: | ||||
| Client.regenerateUuid() |
Declaration:
public static boolean regenerateUuid()
fun regenerateUuid():Boolean
Parameters:
No parameters required.
Return Value:
Returns true if the current Customer is anonymous and the operation succeeds.
Example:
boolean success = Client.regenerateUuid();
var success = Client.regenerateUuid()
Regenerate customer with identifier
This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.
This operation works only if the customer is anonymous.
This operation clears the authentication token, login (if applicable), custom email, and custom identifier
The optional clientIdentifier parameter is a seed for UUID generation.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.6.5 | 3.6.4 | 0.9.10 | 0.7.2 |
| Method name: | ||||
| Client.regenerateUuid(clientIdentifier) |
Declaration:
public static boolean regenerateUuid(clientIdentifier)
fun regenerateUuid(clientIdentifier):Boolean
Parameters:
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| clientIdentifier | String | no | Seed for UUID generation |
The clientIdentifier parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.
Return Value:
Returns true if the current Client is anonymous and the operation succeeds.
Example:
boolean success = Client.regenerateUuid(clientIdentifier);
var success = Client.regenerateUuid(clientIdentifier)
Destroy current session
This method destroys the session completely.
This method clears all session data (both client and anonymous) and removes cached data. Then, it regenerates the UUID and creates the new anonymous session.
Method name:
Client.destroySession()
Declaration:
public static void destroySession()
fun destroySession()
Parameters:
No parameters required.
Return Value:
Method is void type.
Example:
Client.destroySession();
Client.destroySession()