> ## Documentation Index
> Fetch the complete documentation index at: https://docs.median.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Sendbird

> Add Sendbird in-app messaging and push notifications to your app, and manage users, channels, and the Sendbird UI with the JavaScript Bridge.

The Sendbird plugin adds in-app messaging and push notifications to your app using Sendbird’s UI kit and SDKs for iOS and Android. Use it to build messenger experiences and send real-time push notifications.

## Why use Sendbird?

* **Messaging interface and system**: Use Sendbird’s chat interface and features instead of building yours from scratch.
* **Real-time push**: Deliver push notifications to Android and iOS devices using Sendbird.
* **JavaScript Bridge API**: Initialize the SDK, manage users, channels, permissions, and UI from your web layer.

## When to use this plugin

| Use case | Example |
| - | - |
| **In-app messaging** | Let users chat in group channels using Sendbird’s native messaging UI. |
| **Push notifications** | Deliver Sendbird push notifications via APNS (iOS) and FCM (Android). |
| **User sessions** | Sign users in with `userId`, update profile info, disconnect, or sign out as needed. |
| **Channel creation** | Create group channels programmatically and open them in the Sendbird UI. |
| **Demo-driven development** | Load the developer demo in your app to test integration during development. |

## What you'll do

Use this section as a fast navigation map into the full setup and implementation details:

1. **Configure Sendbird and push**: Complete [plugin platform setup](#plugin-platform-setup): retrieve your Application ID, gather APNS (iOS) and FCM (Android) credentials, and enable push with those credentials in the Sendbird dashboard.
2. **Enable and configure in Median**: In [Median App Studio configuration](#median-app-studio-configuration), [enable the plugin](#enable-the-plugin), review the [configuration options](#configuration-options) (including the optional **Advanced Configuration**), and for Android, upload `google-services.json` as described under **Android: `google-services.json`** in that section.
3. **Implement the bridge**: Use [website configuration (JavaScript Bridge)](#website-configuration-javascript-bridge) for SDK initialization, push permission, users, channels, and Sendbird UI (`showUI` / `showChannelUI` / close callback).
4. **Validate your flow**: Use [create group channel](#create-group-channel) and [show channels UI and enter channel](#show-channels-ui-and-enter-channel) to confirm end-to-end behavior.
5. **Test and resolve issues**: Work through [Testing](#testing) and [Troubleshooting](#troubleshooting).

> [!TIP]
>
> **Test  with our demo page**
>
> We host a ready-made demo page at
>
> that calls the  features through the Median JavaScript Bridge.
> Load it inside your Median app during development, either by setting it
> as your app's website URL in App Studio or by navigating to it from your
> own site, and use it to confirm  works on a real device before
> you add it to your own pages.
>
> The demo page only works inside a Median app with  enabled.
> Opened in a regular mobile or desktop browser, the native features
> won't respond. Remember to switch your app back to your own URL before
> release.

## Prerequisites

* A Median app with the JavaScript Bridge enabled
* A Sendbird application and its **Application ID** (from the Sendbird dashboard)
* For **Apple Push Notification service (iOS)**: App Bundle ID (see Median [iOS Bundle ID](https://docs.median.co/docs/app-identifiers.md#ios-bundle-id)), `.p8` or `.p12` authentication token ([Register iOS app with APNS ](https://developer.apple.com/documentation/usernotifications/registering-your-app-with-apns)), Key ID, Team ID, and SSL certificate type
* For **Firebase Cloud Messaging (Android)**: FCM **service account key (HTTP v1)** (generate a new private key under **Project settings → Service accounts** in the Firebase console)
* For Android push: `google-services.json` uploaded in Median App Studio (**Build & Deploy**), and the FCM service account key (HTTP v1) configured in the Sendbird dashboard (see setup steps below)

### Key concepts

The following terms will help you implement Sendbird effectively:

**Sendbird Application ID (`appId`)**: Identifies your Sendbird application. The SDK needs it to initialize; it is shown in your Sendbird dashboard (see Sendbird setup).

**Push credentials (APNS / FCM)**: Values you add in the Sendbird dashboard under **Settings → Push Notifications** so Sendbird can send pushes to your iOS and Android apps.

**Group channel**: A channel where multiple users chat. Creating one returns a `channelUrl` you can use to open the channel in the UI.

**Distinct channel (`isDistinct`)**: When `true`, if a matching channel already exists, that channel is reused instead of creating a duplicate.

> [!NOTE]
>
> **Important considerations**
>
> * If you need help locating push or Firebase values, contact Median support.
> * Android FCM requires `google-services.json` in the app **and** FCM configuration in the Sendbird dashboard (including the FCM service account key (HTTP v1)).

## Integration guide

### Plugin platform setup

Configure Sendbird and push outside Median before or in parallel with the App Studio settings.

#### Retrieve your Sendbird application ID

Sendbird’s SDK requires the **Application ID** of your Sendbird application to initialize. You can find it in the dashboard of your Sendbird application.

![Sendbird dashboard Overview page with the Application ID highlighted](https://mintcdn.com/median-co/GxvcMzxgBpPuoXK3/images/docs/docs/sendbird/dashboard-application-id.png?fit=max\&auto=format\&n=GxvcMzxgBpPuoXK3\&q=85\&s=fc6e7a500c59350c395dd88b28d17f43)

Sendbird – find the Application ID

#### Set up Sendbird push notifications (APNS and FCM)

To deliver Sendbird push notifications to an app, you need the following credentials.

**For Apple Push Notification service (iOS):**

* App Bundle ID: Median [iOS Bundle ID](https://docs.median.co/docs/app-identifiers.md#ios-bundle-id)
* `.p8` or `.p12` authentication token — [Register iOS app with APNS ](https://developer.apple.com/documentation/usernotifications/registering-your-app-with-apns)
* Key ID
* Team ID
* SSL certificate type

**For Firebase Cloud Messaging (Android):**

* Service account key (HTTP v1) — you can generate a new private key under **Project settings → Service accounts** on your Firebase console

Please reach out to Median support for help with finding these values.

#### Sendbird dashboard: enable push and add credentials

In the dashboard of your Sendbird app:

1. Navigate to **Settings → Push Notifications**.
2. Enable push notifications.
3. Add your push notification credentials.

![Sendbird Settings, Chat, Push notifications page with push turned on and Add credential buttons for APNS and FCM highlighted](https://mintcdn.com/median-co/GxvcMzxgBpPuoXK3/images/docs/docs/sendbird/dashboard-push-notification-settings.png?fit=max\&auto=format\&n=GxvcMzxgBpPuoXK3\&q=85\&s=d321adf5f03944d9fcb534ddf57a45ec)

Sendbird – push notification settings

### Median App Studio configuration

#### Enable the plugin

1. In **App Studio**, open the **Native Plugins** tab and enable the **Sendbird** plugin.

![Sendbird plugin settings in App Studio, with Native Plugins highlighted, Plugin Enabled turned on and highlighted, an empty App ID field, and Automatic Registration set to Enable](https://mintcdn.com/median-co/GxvcMzxgBpPuoXK3/images/docs/docs/sendbird/app-studio-plugin-settings.png?fit=max\&auto=format\&n=GxvcMzxgBpPuoXK3\&q=85\&s=648b1ce8c7b94eaf5a20c109234022cf)

App Studio – enable the Sendbird plugin

#### Configuration options

| Setting | Description |
| - | - |
| **App ID** | Optional. If set, the Sendbird SDK is initialized automatically. |
| **Automatic Registration** | When set to **Enable**, push permission is requested automatically. |

#### Android: `google-services.json`

Firebase Cloud Messaging (FCM) requires embedding a `google-services.json` file in the app to send Android push notifications. Upload this file in the **Build & Deploy** tab of App Studio.

![Google Services section of the Build & Deploy page in App Studio, with Build & Deploy and the Add google-services.json button highlighted](https://mintcdn.com/median-co/GxvcMzxgBpPuoXK3/images/docs/docs/sendbird/app-studio-google-services-json.png?fit=max\&auto=format\&n=GxvcMzxgBpPuoXK3\&q=85\&s=f6f52d5cb8a5652e40bee840b947ea11)

App Studio – add google-services.json

Push notifications must also be configured in your **Sendbird** dashboard by adding the FCM service account key (HTTP v1). Refer to the Sendbird push setup steps above.

### Website configuration (JavaScript Bridge)

Unless noted, you may provide a **callback** or use the **promise** returned by the call.

#### Initialize the SDK

Initialize the Sendbird SDK using the `appId` of your Sendbird application. Once initialized, the `appId` is saved and the SDK initializes automatically on the next app start. The `appId` lets you reference users and channels for that Sendbird application. See the Sendbird dashboard screenshot in setup for locating `appId`.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.initialize(STRING);
```

**Parameters:** `appId` (string) — Sendbird Application ID.

#### Verify SDK initialization

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.isInitialized({callback: function})
// Return value if initialized:
{
  "initialized": true,
  "appId": STRING
}
// Return value if not initialized (appId not provided or is invalid):
{
  "initialized": false
}
```

#### Request push notification permission

Request push notification permission. On iOS and Android 13+, a system dialog is shown. On Android 12 and below, permission is granted without user input.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.promptNotification({'callback': function})

// Return value:
{
"granted": true | false
}
```

#### Check push notification permission status

Check whether push notification permission has been granted or denied.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.notificationEnabled({'callback':  function})

// Return value:
{
  "granted": true | false
}
```

#### Sign in or register users

Sign in a user on the Sendbird application using `userId`. If the user doesn't sign out, they stay signed in on future app starts. If `userId` does not exist, a new user is registered.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.setUserId("USER_ID");
```

**Parameters:** `userId` (string).

#### Get user ID

Returns the `userId` of the signed-in user.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.getUserId({callback:  function})
// Return value:
{
 "userId":  STRING
}
```

#### Check user connection

Check whether the user is connected to the Sendbird server after signing in.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.isConnected({callback:  function})
// Return value:
{
 "connected":  BOOLEAN
}
```

#### Update user profile

Update the nickname and profile image URL of the signed-in user.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.updateUserInfo({
 nickname:  STRING,  // optional
 profileImageUrl:  STRING,  // optional
 callback:  function
 })
// Return value:
{
 "success":  BOOLEAN
 }
```

**Parameters:** `nickname` (optional string), `profileImageUrl` (optional string), `callback` (function).

#### Sign out a user

Sign out the current user: disconnects from Sendbird, removes user details from the app, and unregisters push notifications.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.logout({callback:  function})

// Return value
{
"success": BOOLEAN
}
```

#### Disconnect user session

Disconnect the current session. The user remains signed in and details stay saved; the app continues to receive push notifications.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.disconnect({callback:  function})

// Return value
{
 "success":  BOOLEAN
 }
```

#### Create group channel

Creates a group channel. Returns success and the channel URL.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.createGroupChannel({
  name: STRING,
  coverImageUrl: STRING,  // optional
  userIds: [STRING],      // at least 1 userId is required
  isDistinct: BOOLEAN,    // default false; set to true to reuse an existing channel
  customType: STRING,     // optional channel type for grouping
  callback: function
});

// Return value:
{
  "success": BOOLEAN,
  "channelUrl": STRING
}
```

**Parameters:**

| Parameter | Notes |
| - | - |
| `name` | Channel name (string). |
| `coverImageUrl` | Optional. |
| `userIds` | Array of strings; at least one `userId` required. |
| `isDistinct` | Default `false`; set `true` to reuse an existing channel when applicable. |
| `customType` | Optional; for grouping channel types. |
| `callback` | Optional if using promises. |

#### Show channels UI

Displays Sendbird’s messaging UI with the user’s group channels. Users can enter channels, create channels, and leave the UI.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.showUI();
```

![Sendbird channel list UI open in the app simulator](https://mintcdn.com/median-co/GxvcMzxgBpPuoXK3/images/docs/docs/sendbird/demo-app-channels-ui.png?fit=max\&auto=format\&n=GxvcMzxgBpPuoXK3\&q=85\&s=b4df596e5453f1a3872481dd53e0e4ea)

Sendbird demo app – show channels UI

#### Show channels UI and enter channel

Opens Sendbird’s UI and enters a channel by URL.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.sendbird.showChannelUI({ url: STRING });
```

**Parameters:** `url` (string) — channel URL.

![Sendbird chat UI open on a channel in the app simulator](https://mintcdn.com/median-co/GxvcMzxgBpPuoXK3/images/docs/docs/sendbird/demo-app-channel-chat.png?fit=max\&auto=format\&n=GxvcMzxgBpPuoXK3\&q=85\&s=674b096f56bf9e52107ac8fa92dd8d63)

Sendbird demo app – show channels UI and enter channel

#### Close UI callback

Define this function on your webpage to run when the user closes the Sendbird UI:

```javascript JavaScript theme={null}
function median_sendbird_uiclosed() {
  console.log("UI Closed");
}
```

## Testing

Use this checklist to ensure Sendbird is working correctly in your app:

### Basic functionality

* [ ] Sendbird plugin is enabled in Median App Studio and a new build has been generated
* [ ] `median.sendbird.initialize(appId)` completes and `isInitialized` returns `initialized: true` with the expected `appId`
* [ ] `setUserId` signs in (or registers) the expected user; `getUserId` returns the same id
* [ ] `showUI` opens Sendbird’s channel list UI without JavaScript errors

### Push and permissions

* [ ] `promptNotification` shows a permission dialog on iOS and Android 13+ where applicable
* [ ] `notificationEnabled` reflects the system permission state after the user responds
* [ ] Sendbird dashboard push settings include the correct APNS and/or FCM credentials
* [ ] Android: `google-services.json` is present via App Studio **Build & Deploy**

### Channels and UI

* [ ] `createGroupChannel` returns `success` and a `channelUrl` when inputs are valid
* [ ] `showChannelUI` opens the intended channel using that `channelUrl`
* [ ] Closing the Sendbird UI triggers `median_sendbird_uiclosed` when defined

### Session behavior

* [ ] `isConnected` reflects connection after sign-in
* [ ] `logout` clears the session and unregister behavior matches expectations
* [ ] `disconnect` ends the session while user details remain and push can still apply (per documentation)

### Troubleshooting

> [accordion] Where do I get APNS or Firebase / FCM values?
>
> For iOS follow [Apple’s APNS registration guide ](https://developer.apple.com/documentation/usernotifications/registering-your-app-with-apns), and for Android, go to **Project settings → Service accounts** to generate your credentials in your Firebase account.

> [accordion] Push notifications are not arriving
>
> Confirm push is enabled in the Sendbird dashboard (**Settings → Push
> Notifications**), credentials are added, and for Android that
> `google-services.json` is uploaded in App Studio and the FCM service account
> key (HTTP v1) is set in Sendbird (as described in this guide).

> [accordion] Android build or FCM issues
>
> Verify `google-services.json` is uploaded under **Build & Deploy** and that FCM is configured in Sendbird, not only in Firebase alone.

## Still having trouble?

> [!NOTE]
>
> For issues related to Sendbird's own configuration, permissions, or
> platform-specific behavior outside of Median, refer to [Sendbird's integration
> documentation&#x20;
> ](https://sendbird.com/developer/tutorials).


## Related topics

- [Changelog](https://docs.median.co/docs/changelog.md)
- [Push notifications overview](https://docs.median.co/docs/push-notifications-overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.