RevueSDK · Swift reference Guides

Instance Method

startPresence(_:)

Start presence, or replace the running connection with new settings.

@MainActor func startPresence(_ options: MqttOptions? = nil) async throws

Parameters

options

The settings to connect with. nil uses the built-in service. deferStart is ignored here.

Discussion

For an App that initialized with MqttOptions.deferred: call this once the user has signed in. Call it again with another account to switch: the old connection closes first, so the delegate sees .notInitialized, then .connected. Calls run in the order they were made.

Returning without an error only means the request was sent, not that presence is connected. The result arrives through RevueDelegate.revue(_:didUpdatePresenceConnectionState:).

MqttOptions.deferred applies to one initialize(_:), so call this again after destroy(_:).

Throws

RevuePresenceError. .invalidConfiguration leaves the running connection untouched.