Use Full UI
This guide shows you how to use the prebuilt UI components to quickly integrate Agentforce chat functionality into your Android app.
Use the AgentforceLauncherContainer Composable in your screen. It displays a Floating Action Button (FAB) that, when tapped, presents the full chat container.
To display the chat UI, you can use the AgentforceConversationContainer Composable. This Composable provides the complete chat interface that you can integrate into your app.
First, create an AgentforceConversation object:
Then use the AgentforceConversationContainer Composable:
The AgentforceConversationContainer Composable takes the following parameters:
conversation: TheAgentforceConversationobject that you createdonClose: A lambda that will be called when the user closes the chat view
The following example shows a complete Activity implementation that integrates the Agentforce chat UI:
To handle UI events, implement the AgentforceUIDelegate interface. This interface provides callbacks for modifying messages before sending, handling sent messages, and managing agent switches.
The AgentforceUIDelegate interface provides the following methods:
modifyUtteranceBeforeSending(utterance: AgentforceUtterance): Called before an utterance is sent to the agent. Allows you to modify the utterance before it is sent.didSendUtterance(utterance: AgentforceUtterance): Called after an utterance has been sent to the agent.userDidSwitchAgents(newConversation: AgentforceConversation): Called when the user switches to a different agent.
- Headless: See Build a Headless Experience for custom UI
- Customization: See Branding and Theming for visual customization