Skip to main content

Authentication

Authentication

Authentication verifies that the provided user id is correct and, therefore, it can initiate the chat.

MeetingLawyersApp.authenticate(userId: "<#user_id#>") { error in
guard let error = error else {
// AUTH OK
}
// AUTH KO
}

The result of the authentication does not return any value beyond the same verification of success or failure of the operation.

From a successful response, we can consider that the user is authenticated and MeetingLawyers environment is ready to show the active conversations of the user.

note

The Async/Await version of the authenticate method is available:

try await MeetingLawyersApp.authenticate(userId: "<#user_id#>")

Logout

First, you must initialize the SDK before calling this method. If you want to call the authenticate method, please call it inside the logout closure.

A logout method deletes all user cached data, including chat messages and professional list:

MeetingLawyersApp.logout() { error in
guard let error = error else {
// LOGOUT OK
}
// LOGOUT KO
}
note

The Async/Await version of the logout method is available:

try await MeetingLawyersApp.logout()

Next steps