Customer session
Refresh customer token
This method refreshes the customer’s current token.
Method name:
Client.refreshToken()
Declaration:
public static IApiCall refreshToken()
Parameters:
No parameters required.
Return Value:
IApiCall object to execute the request.
Example:
boolean success = Client.refreshToken();
Retrieve customer token
This method retrieves the customer’s current, active token.
Method name:
Client.getToken()
Declaration:
public static IDataApiCall<Token> getToken()
Parameters:
No parameters required.
Return Value:
IDataApiCall<Token> object to execute the request.
Example:
IDataApiCall getTokenCall = Client.getToken();
getTokenCall.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()
Parameters:
No parameters required.
Return Value:
Customer’s UUID as a string.
Example:
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 |
Method name:
Client.getUuidForAuthentication()
Declaration:
public static String getUuidForAuthentication(@NonNull String authId)
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)
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()
Parameters:
No parameters required.
Return Value:
Returns true if the current Customer is anonymous and the operation succeeds.
Example:
boolean 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)
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
clientIdentifier | String | no | Seed for UUID generation |
Return Value:
Returns true if the current Client is anonymous and the operation succeeds.
Example:
boolean 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()
Parameters:
No parameters required.
Return Value:
Method is void type.
Example:
Client.destroySession();