PrivMX DOCS
API Reference/PrivMX Endpoint Swift Extra/Inboxes

InboxEntryHandler

Class wrapping the process of creating and uploading an Inbox Entry.

Fields

RecommendedChunkSize

Int64 Recommended chunk size for file transfers, suggested by the endpoint library.

state

InboxEntryHandlerState The current state

Static Methods

prepareInboxEntryHandler(using:in:containing:sending:derivingPublicKeyFrom:)

Creates a new InboxEntryHandler for sending an entry to an Inbox. If fileSources is an empty array, the created handler will be in .filesSent, otherwise it will be in .prepared.

Params

inboxApi

any PrivMXInbox

provider of PrivMXInbox API

inboxId

String

Id of the Inbox in which the Entry is supposed to appear

data

Data

arbitrary data that will appear as a message in the Inbox

fileSources

[any FileDataSource]

list of sources of data for Files attached to the Entry

userPrivateKey

String?

Optional identity of the Sender.

public static func prepareInboxEntryHandler(
using inboxApi: any PrivMXInbox,
in inboxId:String,
containing data:Data,
sending fileSources: [any FileDataSource],
derivingPublicKeyFrom userPrivateKey:String?
) throws -> InboxEntryHandler

Returns

InboxEntryHandler · an instance of InboxEntryHandler

Methods

sendFiles()

Uploads the files associated with the Entry.

public func sendFiles(
) throws -> InboxEntryHandlerState

Returns

InboxEntryHandlerState · the state of the Handler

cancel()

Aborts sending of the files, if they haven’t been sent already

public func cancel(
) throws -> Void

sendEntry()

Sends the entry, completing the process and adding it to the Inbox.

public func sendEntry(
) throws

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