PrivMX DOCS
API Reference/PrivMX Endpoint Swift Extra/Events

EventApi

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

func emitEvent(
in contextId: String,
to users: [privmx.endpoint.core.UserWithPubKey],
on channelName: String,
containing eventData: Data
) throws -> Void

subscribeForCustomEvents(in:onChannel:)

Subscribes to Custom Events in a specific Context, that arrive on a specific, named Channel

Params

contextId

String

id of the Context

channelName

String

arbitrary name of the channel

func subscribeForCustomEvents(
in contextId: String,
onChannel channelName: String
) throws -> Void

unsubscribeFromCustomEvents(in:onChannel:)

Unsbscribes from Custom Events in a specific Context, that arrive on a specific, named Channel

Params

contextId

String

id of the Context

channelName

String

arbitrary name of the channel

func unsubscribeFromCustomEvents(
in contextId:String,
onChannel channelName: String
) throws -> Void

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

This package is not up to date with the core documentation. Some of the features you've seen described in other parts of the documentation might not be mentioned here. Those changes do not influence compatibility, however