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
- Blueprint
- C++ / Input parameters
1Channel->Leave();
Output
This method doesn't return any value.
Sample code
Leave the support channel.
1#include "Kismet/GameplayStatics.h"
2#include "PubnubChatSubsystem.h"
3
4UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this);
5UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>();
6
7UPubnubChat* Chat = PubnubChatSubsystem ->InitChat("demo", "demo", "my_user");
8
9UPubnubChannel* Channel = Chat->GetChannel("support");
10
11// Create a pubnub response delegate
12// you MUST implement your own callback function to handle the response
13FOnPubnubChannelMessageReceived MessageCallback;
14MessageCallback.BindDynamic(this, &AMyActor::OnMessageReceived);
15
show all 18 lines