Delete channels

Unreal Chat SDK lets you remove an existing channel using the DeleteChannel() methods.

icon

Usage in Blueprints and C++


Both of these methods give the same output. The only difference is that you call a given method either on the Chat or the Channel object. Depending on the object, these methods take a different set of input parameters - you either have to specify the channel ID you want to delete or not because it's already known.

Requires App Context

To store data about channels, you must enable App Context for your app's keyset in the Admin Portal.

Delete a channel (hard delete)

Method signature

Output

These methods don't return any value.

Basic usage

Delete the support channel metadata.

  • Channel->DeleteChannel()

    #include "Kismet/GameplayStatics.h"
    #include "PubnubChatSubsystem.h"

    UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this);
    UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>();

    UPubnubChat* Chat = PubnubChatSubsystem ->InitChat("demo", "demo", "my_user");

    UPubnubChannel* Channel = Chat->GetChannel("support");

    Channel->DeleteChannel();
  • Chat->DeleteChannel()

    #include "Kismet/GameplayStatics.h"
    #include "PubnubChatSubsystem.h"

    UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this);
    UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>();

    UPubnubChat* Chat = PubnubChatSubsystem ->InitChat("demo", "demo", "my_user");

    UPubnubChannel* Channel = Chat->GetChannel("support");

    Chat->DeleteChannel(Channel);
Last updated on