PrivMX DOCS
API Reference/Endpoint/Event

EventApi

'EventApi' is a class representing Endpoint's API for context custom events.

Constructors

EventApi

EventApi()

Static Methods

create

Creates an instance of 'EventApi'.

Params

connection

core::Connection &

instance of 'Connection'

static EventApi create(
core::Connection &connection
)

Returns

EventApi · EventApi object

Methods

emitEvent

Emits the custom event on the given Context and channel.

Params

contextId

const std::string &

ID of the Context

users

const std::vector<core::UserWithPubKey> &

list of UserWithPubKey objects which defines the recipients of the event

channelName

const std::string &

name of the Channel

eventData

const core::Buffer &

event's data

void emitEvent(
const std::string &contextId
const std::vector<core::UserWithPubKey> &users
const std::string &channelName
const core::Buffer &eventData
)

subscribeForCustomEvents

Subscribe for the custom events on the given channel.

Params

contextId

const std::string &

ID of the Context

channelName

const std::string &

name of the Channel

void subscribeForCustomEvents(
const std::string &contextId
const std::string &channelName
)

unsubscribeFromCustomEvents

Unsubscribe from the custom events on the given channel.

Params

contextId

const std::string &

ID of the Context

channelName

const std::string &

name of the Channel

void unsubscribeFromCustomEvents(
const std::string &contextId
const std::string &channelName
)

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.

This is documentation for PrivMX v2.3, which is no longer actively maintained.

For up-to-date documentation, go to latest here