PrivmxEndpoint

class PrivmxEndpoint(enableModule: Set<Modules>, userPrivateKey: String, solutionId: String, bridgeUrl: String) : BasicPrivmxEndpoint, AutoCloseable

Extends BasicPrivmxEndpoint with event callbacks dispatcher.

Parameters

enableModule

set of modules to initialize; should contain Modules.THREAD to enable Thread module or Modules.STORE to enable Store module

bridgeUrl

Bridge's Endpoint URL

solutionId

SolutionId of the current project

userPrivateKey

user private key used to authorize; generated from: CryptoApi.generatePrivateKey or CryptoApi.derivePrivateKey2

Throws

thrown if there is an exception during init modules

thrown if there is a problem during login

thrown if there is an unknown problem during login

Constructors

Link copied to clipboard
constructor(enableModule: Set<Modules>, userPrivateKey: String, solutionId: String, bridgeUrl: String)

Properties

Link copied to clipboard

Reference to Connection module.

Link copied to clipboard

Reference to Inbox module.

Link copied to clipboard

Reference to Store module.

Link copied to clipboard

Reference to Thread module.

Functions

Link copied to clipboard
open override fun close()

Disconnects from PrivMX Bridge and frees memory.

Link copied to clipboard
suspend fun handleEvent(event: Event<out Any>)

Handles event and invokes all related callbacks. It should only be called by event loops.

Link copied to clipboard
suspend fun <T : Any> registerCallback(context: Any, eventType: EventType<T>, callback: EventCallback<T>)

Registers callbacks with the specified type.

Link copied to clipboard
suspend fun unregisterAll()

Unregisters all callbacks registered by registerCallback.

Link copied to clipboard
suspend fun unregisterCallbacks(context: Any)

Unregisters all callbacks registered by registerCallback and identified with given Context.