Leave channels
Requires App Context
Enable App Context for your keyset in the Admin Portal.
Remove a user's channel membership with leave().
Method signature
This method has the following signature:
1channel.leave(): PNFuture<Unit>
Input
This method doesn't take any parameters.
Output
| Type | Description |
|---|---|
PNFuture<Unit> | Function that returns an instance of PNFuture that will be completed with Unit when the leave operation is completed. |
Sample code
Leave the support channel.
1val channel: Channel
2// ...
3
4// you must be a member of the "support" channel...
5channel.join().async {
6 // ...
7}
8// ...to leave it sometime later
9channel.leave().async {
10 // ...
11}