Instance Method
startPresence(_:)
Start presence, or replace the running connection with new settings.
@MainActor func startPresence(_ options: MqttOptions? = nil) async throwsParameters
- options
The settings to connect with.
niluses the built-in service.deferStartis 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..invalidConfigurationleaves the running connection untouched.