Get channel details
Fetch details of a specific channel using the getChannel() method.
Requires App Context
To store data about channels, you must enable App Context for your app's keyset in the Admin Portal.
Method signature
This method takes the following parameters:
1chat.getChannel(channelId: String): PNFuture<Channel?>
Input
* required
| Parameter | Description |
|---|---|
channelId *Type: StringDefault: n/a | Unique channel identifier (up to 92 UTF-8 byte sequences). |
Output
| Type | Description |
|---|---|
PNFuture<Channel> | PNFuture containing the channel object with its metadata. |
Sample code
Fetch the support channel metadata.
1chat.getChannel("support").async { result ->
2 result.onSuccess {
3 // handle success
4 }.onFailure {
5 // handle failure
6 }
7}