Customer session
Refresh customer token
This method refreshes the customer’s current token.
Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> refreshToken({required void Function() onSuccess, required void Function(SyneriseError) onError}) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
onSuccess | Function() | yes | - | Function to be executed when the operation is completed successfully |
onError | Function(SyneriseError error) | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.refreshToken(onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Retrieve customer token
This method retrieves the customer’s current, active token.
Declared In:
lib/modules/client/client_impl.dart
Related To:
Token
Class:
ClientImpl
Declaration:
Future<void> retrieveToken({required void Function(Token) onSuccess, required void Function(SyneriseError) onError}) async
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
onSuccess | Function(Token token) | yes | - |
onError | Function(SyneriseError error) | yes | - |
Return Value:
No value is returned.
Example:
await Synerise.client.retrieveToken(onSuccess: (Token token) {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});
Get current customer UUID
This method retrieves the customer’s current UUID.
Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<String> getUUID() async
Return Value:
String
Example:
await Synerise.client
.getUUID()
.then((result) => {
//result handling
});
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 |
Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> regenerateUUID() async
Return Value:
No value is returned.
Example:
await Synerise.client
.regenerateUUID()
.then((result) => {
//result handling
});
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 |
Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> regenerateUUIDWithClientIdentifier(String clientIdentifier) async
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
clientIdentifier | String | no | Seed for UUID generation |
Return Value:
No value is returned.
Example:
await Synerise.client
.regenerateUUIDWithClientIdentifier(clientIdentifier)
.then((result) => {
//result handling
});
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.
Declared In:
lib/modules/client/client_impl.dart
Class:
ClientImpl
Declaration:
Future<void> destroySession({required void Function() onSuccess, required void Function(SyneriseError) onError}) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
onSuccess | Function() | yes | - | Function to be executed when the operation is completed successfully |
onError | Function(SyneriseError error) | yes | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
await Synerise.client.destroySession(onSuccess: () {
//onSuccess handling
}, onError: (SyneriseError error) {
//onError handling
});