SignalClient
public class SignalClient
Interface for the Signal server. The signal server handles the exchange of encrypted messages and the brokering of public keys.
-
The registered delegates for this Atlas client
Declaration
Swift
public let delegates: Delegates<SignalClientDelegate> -
Our full Signal address (user ID & device ID)
Declaration
Swift
public var signalAddress: SignalAddress? { get set } -
The public label we provided during Signal server registration for this device
Declaration
Swift
public var deviceLabel: String? { get set }
-
Initialize this Signal client.
Declaration
Swift
public init(atlasClient: AtlasClient) throwsParameters
atlasClientthe associated AtlasClient for this SignalClient
-
Create a new identity key and create or replace the Signal server account. Note that any existing devices asssociated with your account will be purged as a result of this action. This should only be used for new accounts or when you need to start over.
Declaration
Swift
public func registerAccount(deviceLabel: String) -> Promise<Void>Parameters
deviceLabelThe public device name to store in the Signal server
Return Value
A Promise to indicate completion or an error condition
-
Register a new device with an existing Signal server account. This uses Forsta’s
autoprovisioning
procedure to safely transfer the private key information from a user’s existing device to this new one.Declaration
Swift
public func registerDevice(deviceLabel: String) -> AutoprovisionTaskParameters
deviceLabelThis device’s public name to store in the Signal server.
Return Value
An
AutoprovisionTaskthat the caller can then wait to.complete(aPromise<Void>), or optionally.cancel(). -
Respond positively to a provision request from a new foreign device. WARNING: This will deliver your private identity key to the requesting device!
Declaration
Swift
public func linkDevice(uuidString: String, ephemeralPublicKey: Data, userAgent: String = "LibRelaySwift") -> Promise<Bool>Parameters
uuidStringthe UUID (string-encoded) provided for provisioning
ephemeralPublicKeythe ephemeral public key (33 bytes) provided by the new device
userAgentour own user agent string
Return Value
A
Promise<Bool>that resolves upon completion. (A resolution oftruemeans our information was used;falsemeans another device handled it first.) -
Delete a device associated with the current Signal server account.
Declaration
Swift
public func deleteDevice(deviceId: UInt32) -> Promise<Void> -
Download an attachment (uses an
AttachmentInfo.idfor retrieval and.keyfor decryption)Declaration
Swift
public func downloadAttachment(_ attachmentInfo: AttachmentInfo) -> Promise<Data> -
Upload an attachment (returns an
AttachmentInfowith.idfor later retrieval and.keyfor decryption)Declaration
Swift
public func uploadAttachment(data: Data, name: String, type: String, mtime: Date) -> Promise<AttachmentInfo> -
Undocumented
Declaration
Swift
public func registerForPushNotifications(pushToken: String, voipToken: String = "") -> Promise<Void>
-
Manage a requested autoprovision registration task for a new device
See moreDeclaration
Swift
public class AutoprovisionTask
View on GitHub
Install in Dash
SignalClient Class Reference