apply For Seat
Apply to go on seat
Apply to Go on Seat
Request to join co-guest session as an audience member.
After calling this method, a co-guest request is sent to all hosts in the live room. The request will remain active until:
Host accepts via acceptApplication
Host rejects via rejectApplication
Timeout expires
You cancel via cancelApplication
Parameter Description
| Parameter | Type | Description |
seatIndex | Int | Desired seat position. Use -1 for automatic seat assignment |
timeout | Int | Maximum wait time (seconds). Range: 10-60 seconds |
extraInfo | String? | Optional metadata (e.g., user introduction, JSON data) |
completion | CompletionHandler? | Callback when request is sent (not when accepted) |
Return Value
The completion handler receives:
code: 0 for success, otherwise error codemessage: Success message or error description
Important: This method only confirms the request was successfully sent. Listen to GuestListener to know when host responds to your application.
Tip: If no host responds within the timeout, GuestListener.onGuestApplicationNoResponse event with NoResponseReason.TIMEOUT will be triggered.
Example
// Apply for auto-assigned seat with 30 second timeout
store.applyForSeat(
seatIndex = -1,
timeout = 30,
extraInfo = "{\"level\": \"VIP\"}",
completion = { code, message ->
if (code == 0) {
println("Application sent successfully")
} else {
println("Failed to send application: $message")
}
}
)
// Add guest event listener
store.addGuestListener(object : GuestListener() {
override fun onGuestApplicationResponded(isAccept: Boolean, hostUser: LiveUserInfo) {
if (isAccept) {
println("Application accepted by ${hostUser.userName}!")
} else {
println("Application rejected by ${hostUser.userName}")
}
}
override fun onGuestApplicationNoResponse(reason: NoResponseReason) {
println("No response: $reason")
}
})Parameters
Seat index, -1 means auto-assign seat
Timeout (unit: seconds)
Extra information
Completion callback