MessagingInAppUI

open fun MessagingInAppUI(onExit: () -> Unit)

A Composable that renders the full messaging UI for this client instance.

Embed this directly in your Compose navigation graph for full control over the hosting context. The composable manages its own internal navigation (pre-chat form, chat feed, transcript download, etc.) and calls onExit when the user navigates back from the root screen.

This composable can also be presented in a ModalBottomSheet for a modal experience:

When embedding this composable in your own activity, declare android:configChanges="smallestScreenSize|screenSize|screenLayout|orientation" (and keyboardHidden if desired) on that host activity. Without this, entering split-screen or multi-window recreates the activity and the conversation UI can render as a blank screen. The SDK-launched MessagingInappActivity already declares these config changes.

Parameters

onExit

Called when the user exits the messaging UI. Typically used to pop the navigation stack or finish the hosting activity.

Samples

uiClient.MessagingInAppUI(onExit = {
    // Navigate back or finish the activity
})
val coroutineScope = rememberCoroutineScope()
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)

val dismissSheet: () -> Unit = {
    coroutineScope.launch { sheetState.hide() }
}

ModalBottomSheet(
    onDismissRequest = { /* Update state to close */ },
    sheetState = sheetState
) {
    Box(Modifier.fillMaxHeight(0.9f)) {
        uiClient.MessagingInAppUI {
            dismissSheet()
        }
    }
}