MessageSender
public class MessageSender
Manage sending messages
-
init with a
SignalClient
Declaration
Swift
public init(signalClient: SignalClient)
-
Transmit a
Sendable
(i.e., a message) to a list ofMessageRecipient
(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<[TransmissionInfo]>
Parameters
sendable
the
Sendable
messagerecipients
the list of recipients (optional) – empty means only send sync to self
syncToSelf
whether or not to sync to our other devices (defaults to
true
)Return Value
a
Promise<[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<TransmissionInfo>
Parameters
receipts
the list of read-receipts for messages from others
Return Value
a
Promise<TransmissionInfo>
indicating the success of the transmission
-
Information from the Signal server about a message transmission activity
See moreDeclaration
Swift
public class TransmissionInfo : CustomStringConvertible