Client
class Client
Initializers
- init(accountId:persistence:) Create a new Client to connect to a particular account
Instance Methods
- accountId() Get the account ID for this Client
- addCallMediaListener(handler:) Event fired when a call is asking for media to send
- addCallRetractListener(handler:) Event fired when a call is retracted or hung up
- addCallRingListener(handler:) Event fired when a new call comes in
- addCallRingingListener(handler:) Event fired when an outgoing call starts ringing
- addCallTrackListener(handler:) Event fired when call has a new MediaStreamTrack to play
- addCallUpdateStatusListener(handler:) Event fired when an existing call changes status (connecting, failed, etc)
- addChatMessageListener(handler:) Event fired when a new ChatMessage comes in on any Chat Also fires when status of a ChatMessage changes, when a ChatMessage is edited, or when a reaction is added
- addChatsUpdatedListener(handler:) Event fired when a Chat’s metadata is updated, or when a new Chat is added
- addConnectionFailedListener(handler:) Event fired when connection fails with a fatal error and will not be retried
- addPasswordNeededListener(handler:) Event fired when client needs a password for authentication
- addStatusOfflineListener(handler:) Event fired when client is disconnected
- addStatusOnlineListener(handler:) Event fired when client is connected and fully synchronized
- addSyncMessageListener(handler:) Event fired when syncing a new ChatMessage that was send when offline. Normally you don’t want this, but it may be useful if you want to notify on app start.
- addTlsCheckListener(handler:) Event fired when TLS checks fail, to give client the chance to override
- displayName() Get the current display name for this account
- enablePush(push_service:endpoint:p256dh:auth:grace:vapid_private_pkcs8:claims:) Enable push notifications
- findAvailableChats(q:) Search for chats the user can start or join
- getChat(chatId:) Find a chat by id
- getChats()
- logout(completely:) Destroy local data for this account
- prepareAttachment(source:) Turn a file into a ChatAttachment for attaching to a ChatMessage
- setInForeground() Let the SDK know the UI is in the foreground
- setNotInForeground() Let the SDK know the UI is in the foreground
- setProfile(profile:publicAccess:) Set the current profile for this account on the server
- start() Start this client running and trying to connect to the server
- startChat(availableChat:) Start or join a chat from the search results
- startOffline() Gets the client ready to use but does not connect to the server
- usePassword(password:) Sets the password to be used in response to the password needed event