Skip to main content

Autentication

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 SDK previously to call this method. If you want to call method authenticate, please call it inside logout clousure.

A logout method delete 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#