Skip to content

Resolved conflict #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,22 +229,33 @@ There are two ways to display the messenger:

![Image](https://github.com/user-attachments/assets/74eea8d0-a984-4fb9-9c35-299b6b35b283)

The SDK provides a `MessengerLauncher` view, which can be added to any application screen via XML or programmatically.
When the screen containing the meesenger is launched, call the `init()` function of `MessengerLauncher` to specify which ai agent to communicate with.
The SDK provides the `MessengerLauncher` view, which can be easily attached to your application's root view programmatically without directly adding it to XML layouts.

To add the MessengerLauncher to your screen, simply call the `attach()` function of `MessengerLauncher`, specifying the AI agent ID and configuration parameters:

> Note: The messenger can be used only after the initialize of AIAgentMessenger has finished. Use it after receiving `onInitSuccess` from the `MessengerInitResultHandler`.

```xml
<com.sendbird.sdk.aiagent.messenger.ui.widget.MessengerLauncher
android:id="@+id/messengerLauncher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
```
```kotlin
messengerLauncher.init(aiAgentId = "your_ai_agent_id")
val params = LauncherLayoutParams(
LaunchMode.ANCHORED,
LauncherMargin(12, 12, 12, 12),
LauncherLocation.BOTTOM_END
)

MessengerLauncher(context).attach(context, aiAgentId = "your_ai_agent_id", params = params)
```

- `LauncherLayoutParams` allows you to configure the MessengerLauncher’s behavior and appearance:
- **`launchMode`**:
- `EXPANDED`: Opens the messenger in full-screen mode with predefined margins.
- `ANCHORED`: Opens the messenger anchored near the launcher button, with adjustable positioning.

- **`margin`**: Defines the margin around the launcher button itself (does not affect the messenger window).

- **`location`**: Determines which corner of the screen the launcher will appear in. Available options are:
- `TOP_START`
- `TOP_END`
- `BOTTOM_START`
- `BOTTOM_END`

#### 2. Opening the conversation channel in full-screen mode

![Image](https://github.com/user-attachments/assets/348ccad1-ec9a-4851-9324-084eaf569e34)
Expand Down