Stream Chat Unreal SDK
Loading...
Searching...
No Matches
FAttachmentPicker Class Reference

Supplies the message composer with a way to pick a file to attach. More...

#include <AttachmentPicker.h>

Public Types

using FOnPicked = TFunction<void(const TOptional<FPickedAttachment>&)>
 
using FProvider = TFunction<void(FOnPicked)>
 Shows a picker and reports back what the user chose.
 

Static Public Member Functions

static void SetProvider (FProvider)
 Register the app's picker. Replaces any previously registered one.
 
static void ClearProvider ()
 
static bool HasProvider ()
 
static void Pick (FOnPicked)
 Ask the registered provider for a file. Does nothing if none is registered.
 

Detailed Description

Supplies the message composer with a way to pick a file to attach.

The SDK ships no picker of its own. Picking a file is a platform decision – a photo library on a handset, a file dialog on desktop, a baked-in asset in a game – and the plugin stays portable by not making it. Register a provider and the composer grows an attach button; register nothing and it does not.

// Show your picker, then, whenever the user is done:
FPickedAttachment Picked{TEXT("shot.png"), MoveTemp(Bytes), true};
OnPicked(Picked); // or OnPicked({}) if they cancelled
});
TFunction< void(const TOptional< FPickedAttachment > &)> FOnPicked
Definition AttachmentPicker.h:46
static void SetProvider(FProvider)
Register the app's picker. Replaces any previously registered one.
Definition AttachmentPicker.cpp:9
A file the app picked, ready to be uploaded and attached to a message.
Definition AttachmentPicker.h:12

Member Typedef Documentation

◆ FOnPicked

using FAttachmentPicker::FOnPicked = TFunction<void(const TOptional<FPickedAttachment>&)>

Called by a provider once the user has chosen a file, or with nothing if they cancelled. Always delivered on the game thread, whichever thread the provider calls it from.


The documentation for this class was generated from the following files: