Delete users
Remove users with Delete().
Asynchronous and synchronous method execution
Most PubNub Unreal SDK methods are available in both asynchronous and synchronous variants.
-
Asynchronous methods (
Asyncsuffix) returnvoidand take an optional delegate parameter that fires when the operation completes.1User->DeleteAsync(OnOperationResponseDelegate);You can also use native callbacks that accept lambdas instead of dynamic delegates. Native callback types have the
Nativesuffix (for example,FOnPubnubChatOperationResponseNative). -
Synchronous methods (no suffix) block the main game thread until the operation completes and return a result struct directly.
1FPubnubChatOperationResult Result = User->Delete();
User->Delete()- call on aUserobject (no ID needed)Chat->DeleteUser()- call on aChatobject (requires user ID)
Requires App Context
Enable App Context in the Admin Portal to store user data.
Delete a user (hard delete)
Method signature
- C++ / Input parameters
- Blueprint
-
User->Delete()1User->Delete(); -
Chat->DeleteUser()1Chat->DeleteUser(FString UserID);
| Parameter | Required in User->Delete() | Required in Chat->DeleteUser() | Description |
|---|---|---|---|
UserIDType: FStringDefault: n/a | No | Yes | Unique user identifier (up to 92 UTF-8 characters). |
Output
| Type | Description |
|---|---|
FPubnubChatOperationResult | Returned object containing Error (bool) and ErrorMessage (FString). |
Sample code
Reference code
This example is a self-contained code snippet ready to be run. Set up your Unreal project and follow the instructions in the lines marked with ACTION REQUIRED before running the code. Use it as a reference when working with other examples in this document.
Delete a user asynchronously.
Chat->DeleteUser()
- C++
- Blueprint
1