Enter Waiting Room Flow (Android)
To enter a waiting room, the user first logs in to VSee with a patient account, an SSO token, or as a guest.

For the same flow on iOS, see Enter Waiting Room Flow under Mobile flows.
1. Authentication
1.1. Patient authentication

val res = VseeApi.auth.loginAsPatient(username = username, password = password)
when (res) {
is Resource.Success -> {}
is Resource.Error -> {}
}
The sample app uses the loginAsPatient API to authenticate the patient.
1.2. Guest authentication

fun loginAsGuest(firstName: String, lastName: String, dob: String) {
viewModelScope.launch {
val res = VseeApi.auth.loginAsGuest(firstName = firstName, lastName = lastName, dob = dob)
when (res) {
is Resource.Success -> {}
is Resource.Error -> Timber.e("Login SSO error: ${res.message}")
}
}
}
To log in as a guest, the user enters their firstName, lastName, and date of birth.
1.3. SSO authentication

fun loginWithToken(token: String) {
viewModelScope.launch {
val res = VseeApi.userApi.getUser()
when (res) {
is Resource.Success -> {}
is Resource.Error -> {
Timber.e("Get user using SSO token error: ${res.message}")
_errorMessage.postValue(res.message ?: "Login using SSO token error")
}
}
}
}
The sample app uses VseeApi.userApi.getUser() to verify the SSO token.
The authentication result is either Success or Error.
- Success: the app starts VSeeKit authentication.
fun loginVseeKit() {
Timber.d("Login vsee-kit...")
if (vseeConnection.getLoginState() != LoginState.LOGGED_IN) {
EventBus.getDefault().register(this)
vseeConnection.login()
} else {
_vseeKitLoginState.postValue(LoginState.LOGGED_IN)
}
}
VSeeKit is a library for embedding VSee multi-way video calling and chat in mobile apps.
The app uses EventBus to listen for the VSeeKit login result:
@Subscribe
fun onLoginStateChanged(event: VSeeEvents.LoginStateChange) {
Timber.d("LoginStateChange => oldState = ${event.oldState}, newState = ${event.newState}")
val newState = event.newState
if (newState.isProcessing()) {
isLoading.postValue(true)
} else if (newState.isLoggedIn() || newState.isFailureState) {
isLoading.postValue(false)
}
_vseeKitLoginState.postValue(newState)
}
Once VSeeKit login succeeds, the user is taken to the Dashboard screen:

- Error: the app shows a Snackbar message with details of the error.

2. Create intake
The patient taps Enter waiting room now to open the intake form. Here they can update medical information for the visit, such as the reason and the consultation.
For details, see the Intake & Visit API.

fun createIntake(reasonForVisit: String) {
val request = CreateIntakeRequest(
reasonForVisit = reasonForVisit,
type = 1,
roomCode = VseeApi.session.getRoomCode().orEmpty(),
consent = true
)
viewModelScope.launch {
val res = VseeApi.visitApi.createIntake(request)
when (res) {
is Resource.Success -> {}
is Resource.Error -> Timber.e("Unable to create visit intake: ${res.message}")
}
}
}
3. Join the video call
The patient has two ways to join the video call:
- Embedded browser call: opens the video call in an Android WebView.
- Via VSeeKit: opens the video call in the VSeeKit native video view.

The app only needs to pass a VisitResponse to the startVideoCall function:
fun startVideoCall(visit: VisitResponse) {
if (performCallUsingVseeKit) {
videoCallManager.startVideoCall(visit)
} else {
findNavController().navigate(
PreWaitingRoomFragmentDirections.actionPreWaitingRoomToWebCall(url, visitId = visit.id)
)
}
}
4. In the video call
The patient waits for their provider to join the video call.
