Custom Events
Custom events allow emitting and receiving data of any shape in a secure, end-to-end encrypted way.
Custom events allow you to send information to specific groups of users. The data will not be stored anywhere. The recipient must be subscribed to the channel on which the event is emitted to receive it.
Before working with Custom Events, follow our Getting Started Guide. It will show you how to set up your project to work with PrivMX Bridge.
Sample code on this page is based on the initial assumptions.
Custom Events use is analogous to normal Event handling.
Working with Custom Events
Key Considerations
Please note the following:
- Events will only trigger for active connections.
- Events are not captured unless explicitly listened for.
- A single instance of the
eventQueue
is shared across all connections.
Emitting and Handling Custom Events
Below there's an example of how to send a Custom Event to User1 and User2 on the channel context/CONTEXT_ID/CUSTOM_CHANNEL
.
To handle an event you simply need to register a callback for it, the same way all other events are handled.
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.
PrivMX Endpoint Swift v2.3