[iOS] Authentication API
Login
The userLogin
method is used to authenticate a user with a username and password.
public func userLogin(userName: String,
password: String,
success: @escaping() -> Void,
failure: @escaping (Error) -> Void)
Parameter | Type | Description |
---|---|---|
|
| The user’s username. |
|
| The user’s password. |
|
| A closure called when the authentication is successful. |
|
| A closure called when the authentication fails, with the error parameter. |
Example Usage
AuthenticateService.shared.userLogin(userName: username, password: password, success: {
// Authentication successful
// Perform any actions or navigate to the next screen
}, failure: { error in
// Authentication failed
// Handle the error or display an error message
})
Â
Guest Login
The userLogin
method is used to authenticate a user with a username and password.
public func guestLogin(_ firstName: String,
lastName: String,
success: @escaping() -> Void,
failure: @escaping (Error) -> Void)
Parameter | Type | Description |
---|---|---|
|
| The guest’s first name. |
|
| The guest’s last name. |
|
| A closure called when the authentication is successful. |
|
| A closure called when the authentication fails, with the error parameter. |
Example Usage
Â
Login By Token (SSO)
The loginBySSOToken
method is used to authenticate a user using a single sign-on (SSO) token.
Parameter | Type | Description |
---|---|---|
|
| The single sign-on token. |
|
| A closure called when the authentication is successful. |
|
| A closure called when the authentication fails, with the error parameter. |
Example Usage
Â
Logout
The logoutVC
method is used to log out of the VSee Clinic session.
Parameter | Type | Description |
---|---|---|
|
| A closure called when the logout is successful. |
|
| A closure called when the logout fails, with the error parameter. |
Example Usage
Â
Â
Restore Logged in Session
The restoreLoginSession
method is used to restore a login session.
Parameter | Type | Description |
---|---|---|
|
| A closure called when the login session is successfully restored. |
|
| A closure called when restoring the login session fails, with the error parameter. |
Example Usage
Â