Learn how to connect to the chat server and set connection settings.
QBChatDelegate
to handle different connection states.
<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/><text xml:lang='en'>Password not verified</text></failure>
.Argument | Required | Description |
---|---|---|
userID | yes | The ID of a user |
userPassword | yes | Specifies an active QuickBlox user session token set as a password. |
disconnect()
method when an app goes to the background and connect()
method when an app goes to the foreground. As a result, the SDK will disconnect/connect the current user from the chat server when the app goes to the background/foreground mode.
Parameters | Description |
---|---|
autoReconnectEnabled | iOS SDK reconnects automatically to the chat server when the connection to the server is lost. Default: false. |
reconnectTimerInterval | A reconnect timer can optionally be used to attempt a reconnect periodically. Set in seconds. Default: 5. |
carbonsEnabled | Message carbons allow for real-time message syncing between devices. Default: false. |
keepAliveInterval | Keep-alive option for a socket connection. Keep-alive is the option allowing to detect a stale connection. Set in seconds. Default: 20. |
streamManagementSendMessageTimeout | The timeout value for stream management. Set in seconds. If this parameter is greater than 0, then it is applied, otherwise, it is not applied. Default: 0. |
networkIndicatorManagerEnabled | A boolean value indicating whether the manager is enabled. If true, the manager will change status bar network activity indicator according to network operation notifications it receives. Default: false. |