On this page

Leave channels

Requires App Context

Enable App Context for your keyset in the Admin Portal.

Remove a user's channel membership with Leave().

icon

Usage in Blueprints and C++


Asynchronous and synchronous method execution

Most PubNub Unreal SDK methods are available in both asynchronous and synchronous variants.

  • Asynchronous methods (Async suffix) return void and take an optional delegate parameter that fires when the operation completes.

    1Channel->LeaveAsync(OnLeaveResponseDelegate);

    You can also use native callbacks that accept lambdas instead of dynamic delegates. Native callback types have the Native suffix (for example, FOnPubnubChatOperationResponseNative).

  • Synchronous methods (no suffix) block the main game thread until the operation completes and return a result struct directly.

    1FPubnubChatOperationResult Result = Channel->Leave();

Method signature

1Channel->Leave();

Output

TypeDescription
FPubnubChatOperationResult
Result of the operation. Check Error for failure.

Sample code

Leave the support channel.

1

Last updated on