EventApi
‘EventApi’ is a class representing Endpoint’s API for context custom events.
Methods
emitEvent(in:to:on:containing:)
Emits a new Custom Event
Params
contextId
String
id of the Context in which the Event will be emited
users
[privmx.endpoint.core.UserWithPubKey]
users that will receive the Event
channelName
String
channel name on which the event will be emitted
eventData
Data
arbitrary payload of the Event
subscribeFor(_:)
Subscribe for the events on the given subscription queries. Use the buildSubscriptionQuery(channelName:selectorType:selectorId:) method to generate properly formatted subscription query.
Params
subscriptionQueries
[String]
list of queries
Returns
[String] ·
list of subscriptionIds in maching order to subscriptionQueries.
unsubscribeFrom(_:)
Unsubscribe from events for the given subscriptionId.
Params
subscriptionIds
[String]
list of subscriptionId
buildSubscriptionQuery(forChannel:selectorType:selectorId:)
Generate subscription Query for the Custom events.
Params
channelName
String
name of the Custom event channel
selectorType
privmx.endpoint.event.EventSelectorType
scope on which you listen for events
selectorId
String
ID of the selector
Returns
String ·
a properly formatted event subscription request.
We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.