SMINavigation

interface SMINavigation

Provides navigation state and actions for navigating between messaging screens from a replaced UI component.

Access this via LocalSMINavigation within a custom ViewComponents composable to programmatically navigate to SDK screens (chat feed, pre-chat, attachments, etc.) or to conditionally render components based on the current route.

See also

Samples

uiClient.viewComponents = object : ViewComponents {
    @Composable
    override fun ChatTopAppBar(content: @Composable () -> Unit) {
        val navigation = LocalSMINavigation.current
        val currentRoute = navigation.currentRoute?.route

        if (currentRoute?.contains("ChatFeed") == true) {
            Column {
                Text(
                    text = "Custom Chat Header",
                    style = MaterialTheme.typography.titleLarge,
                    modifier = Modifier.padding(16.dp)
                )
                Button(onClick = { navigation.navigateToOptions() }) {
                    Text("Options")
                }
            }
        } else {
            content()
        }
    }
}

Properties

Link copied to clipboard

The current navigation destination, or null if the navigation graph has not yet been initialized.

Link copied to clipboard

The previous navigation destination, or null if there is no back stack entry.

Functions

Link copied to clipboard
abstract fun navigateBack()

Navigates back to the previous screen in the navigation stack.

Link copied to clipboard
abstract fun navigateToAttachmentViewer(attachmentId: String? = null)

Navigates to the attachment viewer screen.

Link copied to clipboard
abstract fun navigateToChatFeed(entryId: String? = null)

Navigates to the chat feed screen.

Link copied to clipboard
abstract fun navigateToForm(entryId: String? = null)

Navigates to the interactive form screen.

Link copied to clipboard
abstract fun navigateToOptions()

Navigates to the conversation options screen.

Link copied to clipboard
abstract fun navigateToPreChat(mode: PreChatMode = PreChatMode.SubmissionReceipt)

Navigates to the pre-chat form screen.

Link copied to clipboard

Navigates to the transcript viewer screen.