---
source_url: https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/join
title: Join channels
updated_at: 2026-06-15T12:11:30.737Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Join channels

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) on your keyset in the [Admin Portal](https://admin.pubnub.com/) to manage memberships.
:::

Use `join()` to create a user's membership on a channel. To also receive messages, call [onMessageReceived()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/watch) separately.

## Method signature

`join()` creates a new `Membership` object that represents the user-channel relationship. Unlike previous versions, `join()` only sets membership. Use [onMessageReceived()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/watch) to subscribe to incoming messages and [Membership.setLastReadMessageTimetoken()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/unread#mark-messages-as-read-one-channel) to track read status.

This method takes the following parameters:

```kotlin
channel.join(
    status: String? = null,
    type: String? = null,
    custom: CustomObject? = null,
): PNFuture<Membership>
```

### Input

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | String | Optional | `null` | Optional membership status value. |
| type | String | Optional | `null` | Optional membership type value. |
| custom | CustomObject | Optional | `null` | Any custom properties or metadata associated with the channel-user membership in the form of a `Map`. Values must be scalar only; arrays or objects are not supported. |

### Output

| Type | Description |
| --- | --- |
| `PNFuture<Membership>` | Returned object containing the created membership data. |

## Sample code

```kotlin
val channel: Channel
// ...

// join the channel and add metadata to the newly created membership
channel.join(custom = mapOf("support_plan" to "premium")).async {
    it.onSuccess { membership ->
        // handle success
        println("Joined channel: ${membership.channel.id}")
    }.onFailure {
        // handle failure
    }
}

// to also receive messages, call onMessageReceived() separately
channel.onMessageReceived { message ->
    println(message.text)
}
```