PrivMX DOCS
API Reference/PrivMX Endpoint Swift/Events

EventApi

Static Methods

create(connection:)

Creates a new instance of EventApi from a Connection object. This method initializes the EventApi instance, enabling CustomEvent-related operations over the specified connection.

Params

connection

inout Connection

The connection object to be used for interacting with Custom Events.

public static func create(
connection: inout Connection
) throws -> EventApi

Returns

EventApi · A newly created EventApi instance.

Methods

emitEvent(contextId:users:channelName:eventData:)

Emits the custom event on the given Context and channel.

Params

contextId

std.string

ID of the Context

users

privmx.UserWithPubKeyVector

event’s data

channelName

std.string

list of UserWithPubKey objects which defines the recipients of the event

eventData

privmx.endpoint.core.Buffer

name of the Channel

public func emitEvent(
contextId: std.string,
users: privmx.UserWithPubKeyVector,
channelName: std.string,
eventData: privmx.endpoint.core.Buffer,
) throws -> Void

subscribeForCustomEvents(contextId:channelName:)

Subscribe for the custom events on the given channel.

Params

contextId

std.string

ID of the Context

channelName

std.string

name of the Channel

public func subscribeForCustomEvents(
contextId: std.string,
channelName:std.string
) throws -> Void

unsubscribeFromCustomEvents(contextId:channelName:)

Unsubscribe from the custom events on the given channel.

Params

contextId

std.string

ID of the Context

channelName

std.string

name of the Channel

public func unsubscribeFromCustomEvents(
contextId: std.string,
channelName: std.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