generateToken static method
void
generateToken(
- String sessionId,
- String userAuthToken, {
- required dynamic onSuccess(
- GenerateToken generateToken
- required dynamic onError(
- CometChatCallsException error
Generates a call token.
sessionId
: The session ID.userAuthToken
: The user auth token.onSuccess
: A callback function that is called when the call token is successfully generated.onError
: A callback function that is called when an error occurs while generating the call token.
Example: CometChatCalls.generateToken( sessionId: '<YOUR_SESSION_ID>', userAuthToken: '<YOUR_USER_AUTH_TOKEN>', onSuccess: (generateToken) { // The call token was successfully generated. }, onError: (error) { // An error occurred while generating the call token. }, );
Implementation
static void generateToken(String sessionId, String userAuthToken,
{required Function(GenerateToken generateToken) onSuccess,
required Function(CometChatCallsException error) onError}) async {
CometchatcallsPluginPlatform.instance
.generateToken(sessionId, userAuthToken, onSuccess, onError);
}