ChatClient
public class ChatClient
                ChatClient class for ChatThread operations.
- 
                  
                  
Undocumented
Declaration
Swift
public weak var pushNotificationKeyStorage: PushNotificationKeyStorage? 
- 
                  
                  
Create a ChatClient.
Declaration
Swift
public init( endpoint: String, credential: CommunicationTokenCredential, withOptions userOptions: AzureCommunicationChatClientOptions ) throwsParameters
endpointThe Communication Services endpoint.
credentialThe user credential.
userOptionsOptions used to configure the client.
 
- 
                  
                  
Create a ChatThreadClient for the ChatThread with id threadId.
Declaration
Swift
public func createClient(forThread threadId: String) throws -> ChatThreadClientParameters
threadIdThe threadId.
 - 
                  
                  
Create a new ChatThread.
Declaration
Swift
public func create( thread: CreateChatThreadRequest, withOptions options: CreateChatThreadOptions? = nil, completionHandler: @escaping HTTPResultHandler<CreateChatThreadResult> )Parameters
threadRequest for creating a chat thread with the topic and optional members to add.
optionsCreate chat thread options.
completionHandlerA completion handler that receives a ChatThreadClient on success.
 - 
                  
                  
Gets the list of ChatThreads for the user.
Declaration
Swift
public func listThreads( withOptions options: ListChatThreadsOptions? = nil, completionHandler: @escaping HTTPResultHandler<PagedCollection<ChatThreadItem>> )Parameters
optionsList chat threads options.
completionHandlerA completion handler that receives the list of chat thread items on success.
 - 
                  
                  
Delete the ChatThread with id chatThreadId.
Declaration
Swift
public func delete( thread threadId: String, withOptions options: DeleteChatThreadOptions? = nil, completionHandler: @escaping HTTPResultHandler<Void> )Parameters
threadIdThe chat thread id.
optionsDelete chat thread options.
completionHandlerA completion handler.
 - 
                  
                  
Start receiving realtime notifications. Call this function before subscribing to any event.
Declaration
Swift
public func startRealTimeNotifications(completionHandler: @escaping (Result<Void, AzureError>) -> Void)Parameters
completionHandlerCalled when starting notifications has completed.
 - 
                  
                  
Stop receiving realtime notifications. This function would unsubscribe to all events.
Declaration
Swift
public func stopRealTimeNotifications() - 
                  
                  
Subscribe to chat events.
Declaration
Swift
public func register( event: ChatEventId, handler: @escaping TrouterEventHandler )Parameters
eventThe chat event to subsribe to.
handlerThe handler for the chat event.
 - 
                  
                  
Unsubscribe to chat events.
Declaration
Swift
public func unregister( event: ChatEventId )Parameters
eventThe chat event to unsubsribe from.
 - 
                  
                  
Start push notifications. Receiving of notifications can be expected after successfully registering.
Declaration
Swift
public func startPushNotifications( deviceToken: String, completionHandler: @escaping (Result<HTTPResponse?, AzureError>) -> Void )Parameters
deviceTokenAPNS push token.
completionHandlerSuccess indicates request to register for notifications has been received.
 - 
                  
                  
Stop push notifications.
Declaration
Swift
public func stopPushNotifications( completionHandler: @escaping (Result<HTTPResponse?, AzureError>) -> Void )Parameters
completionHandlerSuccess indicates push notifications have been stopped.
 
            View on GitHub
          
      ChatClient Class Reference