ForstaClient

public class ForstaClient

This is THE top-level helper class for using LibForstaSwift.

  • The DispatchQueue that LibForstaSwift will do any asyncronous internal work on (Serial, QoS of Utility)

    Declaration

    Swift

    public static let workQueue: DispatchQueue
  • The DispatchQueue that LibForstaSwift will do any background, concurrent asyncronous internal work on (Concurrent, QoS of Background)

    Declaration

    Swift

    public static let bgQueue: DispatchQueue
  • An Atlas client for Forsta Atlas server operations. This will restore from the kvstore and continue using an authenticated session if possible.

    Declaration

    Swift

    public let atlas: AtlasClient
  • A Signal client for Forsta Signal server operations. This uses the kvstore to maintain cryptographic messaging keys and sessions, and remote account/device identities.

    Declaration

    Swift

    public let signal: SignalClient
  • Connect the Signal server web socket for messaging.

    Declaration

    Swift

    public func connect() throws
  • Disconnect the Signal server web socket.

    Declaration

    Swift

    public func disconnect()
  • Transmit a Sendable (i.e., a message) to a list of MessageRecipient (specific devices and/or users’ whole collections of devices)

    Note: References to self (our specific .device, or all of our devices in the case of our .user) are ignored in the list of recipients.

    Declaration

    Swift

    public func send(_ sendable: Sendable,
                     to recipients: [MessageRecipient] = [],
                     syncToSelf: Bool = true) -> Promise<[MessageSender.TransmissionInfo]>

    Parameters

    sendable

    the Sendable message

    recipients

    the list of recipients (optional) – empty means only send sync to self

    syncToSelf

    whether or not to send this message to our other devices (defaults to true)

    Return Value

    a Promise<[MessageSender.TransmissionInfo]> with information about the transmission to each of the recipients

  • Send a sync message of a list of SyncReadReceipt to our other devices to indicate specific messages having been read.

    Declaration

    Swift

    public func sendSyncReadReceipts(_ receipts: [SyncReadReceipt]) -> Promise<MessageSender.TransmissionInfo>

    Parameters

    receipts

    the list of read-receipts for messages from others

    Return Value

    a Promise<MessageSender.TransmissionInfo> indicating the success of the transmission