---
url: https://talkjs.com/docs/Data_APIs/Swift/Conversations/
title: "Conversations | Swift | TalkJS Documentation"
---

For AI agents: Find a documentation index at https://talkjs.com/llms.txt (full content at https://talkjs.com/llms-full.txt). Get a markdown version of any page by appending .md to its URL path.

# Conversations

Get and manage conversation data.

A conversation is a chat channel where messages can be sent. Users can participate in many conversations at once.

## struct ConversationRef

### Method Overview

<table class="my-0"><tbody><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__createIfNotExists" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">createIfNotExists</a></td><td><p>Creates this conversation if it does not already exist.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__deleteFields" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">deleteFields</a></td><td><p>Deletes properties of this conversation.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__get" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">get</a></td><td><p>Fetches a snapshot of the conversation.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__markAsRead" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">markAsRead</a></td><td><p>Marks the conversation as read.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__markAsTyping" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">markAsTyping</a></td><td><p>Marks the current user as typing in this conversation for 10 seconds.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__markAsUnread" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">markAsUnread</a></td><td><p>Marks the conversation as unread.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__message" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">message</a></td><td><p>Get a reference to a message in this conversation</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__participant" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">participant</a></td><td><p>Get a reference to a participant in this conversation</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__send" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">send</a></td><td><p>Sends a text message in the conversation.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__set" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">set</a></td><td><p>Sets properties of this conversation and your participation in it.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__subscribe" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">subscribe</a></td><td><p>Subscribes to the conversation.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__subscribeMessages" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">subscribeMessages</a></td><td><p>Subscribes to the messages in the conversation.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__subscribeParticipants" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">subscribeParticipants</a></td><td><p>Subscribes to the participants in the conversation.</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__subscribeTyping" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">subscribeTyping</a></td><td><p>Subscribes to the typing status of the conversation.</p></td></tr></tbody></table>

### Properties

**id**: String

The ID of the referenced conversation.

Immutable: if you want to reference a different conversation, get a new `ConversationRef` instead.

### createIfNotExists

func _conversationRef_.createIfNotExists(access:custom:notify:photoUrl:subject:welcomeMessages:) async

Creates this conversation if it does not already exist.

Adds you as a participant in this conversation, if you are not already a participant.

If the conversation already exists or you are already a participant, this operation is still considered successful. The function throws if you are not already a participant and client-side conversation syncing is disabled.

#### Parameters

**access _(optional)_**: [ConversationAccess](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationAccess)?

Your access to the conversation. Default = `.ReadWrite` access.

**custom _(optional)_**: \[String : String\]?

Custom metadata you have set on the conversation. Default = no custom metadata

**notify _(optional)_**: [NotificationSettings](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#NotificationSettings)?

Your notification settings. Default = `.True`

**photoUrl _(optional)_**: String?

The URL for the conversation photo to display in the chat header. Default = no photo, show a placeholder image.

**subject _(optional)_**: String?

The conversation subject to display in the chat header. Default = no subject, list participant names instead

**welcomeMessages _(optional)_**: \[String\]?

System messages which are sent at the beginning of a conversation. Default = no messages.

#### Returns

Void

### deleteFields

func _conversationRef_.deleteFields(\_:) async

Deletes properties of this conversation.

Pass the name of each property to delete as a separate parameter to this function. To delete a field in the `custom` property, pass it as `custom.FIELD_TO_DELETE`.

#### Parameters

**fields _(unnamed)_**: String...

#### Returns

Void

### get

func _conversationRef_.get() async -> [ConversationSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSnapshot)?

Fetches a snapshot of the conversation.

This contains all of the information related to the conversation and the current user’s participation in the conversation.

#### Returns

[ConversationSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSnapshot)?

A snapshot of the current user’s view of the conversation, or `nil` if the current user is not a participant (including if the conversation doesn’t exist)

### markAsRead

func _conversationRef_.markAsRead() async

Marks the conversation as read.

The function throws if you are not a participant in the conversation.

#### Returns

Void

### markAsTyping

func _conversationRef_.markAsTyping() async

Marks the current user as typing in this conversation for 10 seconds.

This means that other users will see a typing indicator in the UI, from the current user.

The user will automatically stop typing after 10 seconds. You cannot manually mark a user as “not typing”. Users are also considered “not typing” when they send a message, even if that message was sent from a different tab or using the REST API.

To keep the typing indicator visible for longer, call this function again to reset the 10s timer.

#### Returns

Void

### markAsUnread

func _conversationRef_.markAsUnread() async

Marks the conversation as unread.

The function throws if you are not a participant in the conversation.

#### Returns

Void

### message

func _conversationRef_.message(id:) -> [MessageRef](https://talkjs.com/docs/Data_APIs/Swift/Messages/#MessageRef)

Get a reference to a message in this conversation

#### Parameters

**id**: String

The message ID

#### Returns

[MessageRef](https://talkjs.com/docs/Data_APIs/Swift/Messages/#MessageRef)

A reference to the message with the given ID

### participant

func _conversationRef_.participant(user:) -> [ParticipantRef](https://talkjs.com/docs/Data_APIs/Swift/Participants/#ParticipantRef)

Get a reference to a participant in this conversation

#### Parameters

**user**: String

The user’s ID

#### Returns

[ParticipantRef](https://talkjs.com/docs/Data_APIs/Swift/Participants/#ParticipantRef)

A reference to the given participant

### send

func _conversationRef_.send(text:referencedMessage:custom:) async -> [MessageRef](https://talkjs.com/docs/Data_APIs/Swift/Messages/#MessageRef)

func _conversationRef_.send(content:referencedMessage:custom:) async -> [MessageRef](https://talkjs.com/docs/Data_APIs/Swift/Messages/#MessageRef)

Sends a text message in the conversation.

#### Parameters

**text**: String

The text to send in the message.

**referencedMessage _(optional)_**: String?

The message that you are replying to. Default = not a reply

**custom _(optional)_**: \[String : String\]?

Custom metadata you have set on the message. Default = no custom metadata

**content**: \[any [SendContentBlock](https://talkjs.com/docs/Data_APIs/Swift/Message_Content/#SendContentBlock)\]

The most important part of the message, either some text, a file attachment, or a location. By default users do not have permission to send [Link](https://talkjs.com/docs/Data_APIs/Swift/Message_Content/#Link), [ActionLink](https://talkjs.com/docs/Data_APIs/Swift/Message_Content/#ActionLink), or [ActionButton](https://talkjs.com/docs/Data_APIs/Swift/Message_Content/#ActionButton), as they can be used to trick the recipient.

#### Returns

[MessageRef](https://talkjs.com/docs/Data_APIs/Swift/Messages/#MessageRef)

A reference to the newly created message. The function throws if you are not a participant with write access in this conversation.

### set

func _conversationRef_.set(subject:photoUrl:welcomeMessages:custom:access:notify:) async

Sets properties of this conversation and your participation in it.

The conversation is created if a conversation with this ID doesn’t already exist. You are added as a participant if you are not already a participant in the conversation. When client-side conversation syncing is disabled, you may only set your `notify` property, when you are already a participant. Everything else requires client-side conversation syncing to be enabled, and will cause the function to throw.

Properties that are `nil` will not be changed. To clear / reset a property to the default, call [ConversationRef.deleteFields](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__deleteFields) instead.

#### Parameters

**subject _(optional)_**: String?

The conversation subject to display in the chat header. Default = no subject, list participant names instead.

**photoUrl _(optional)_**: String?

The URL for the conversation photo to display in the chat header. Default = no photo, show a placeholder image.

**welcomeMessages _(optional)_**: \[String\]?

System messages which are sent at the beginning of a conversation. Default = no messages.

**custom _(optional)_**: \[String : String?\]?

Custom metadata you have set on the conversation. This value acts as a patch. Remove specific properties by calling [ConversationRef.deleteFields](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationRef__deleteFields) Default = no custom metadata

**access _(optional)_**: [ConversationAccess](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationAccess)?

Your access to the conversation. Default = `.ReadWrite` access.

**notify _(optional)_**: [NotificationSettings](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#NotificationSettings)?

Your notification settings. Default = `.True`

#### Returns

Void

### subscribe

func _conversationRef_.subscribe(onSnapshot:) -> [ConversationSubscription](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSubscription)

Subscribes to the conversation.

Whenever `Subscription.state.type` is “active” and something about the conversation changes, `onSnapshot` will fire and `Subscription.state.latestSnapshot` will be updated. This includes changes to nested data. As an extreme example, `onSnapshot` would be called if `snapshot.lastMessage.referencedMessage.sender.name` changes.

The snapshot is nil if you are not a participant in the conversation (including when the conversation doesn’t exist)

#### Parameters

**onSnapshot _(optional)_**: (@Sendable (\_ snapshot: [ConversationSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSnapshot)?) -> Void)?

#### Returns

[ConversationSubscription](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSubscription)

### subscribeMessages

func _conversationRef_.subscribeMessages(onSnapshot:) -> [MessageSubscription](https://talkjs.com/docs/Data_APIs/Swift/Messages/#MessageSubscription)

Subscribes to the messages in the conversation.

Initially, you will be subscribed to the 10 most recent messages and any new messages. Call `loadMore` to load additional older messages.

Whenever a message is edited, a new message is received, or you load more messages, `onSnapshot` will fire and `Subscription.latestSnapshot` will be updated. `loadedAll` is true when the snapshot contains all the messages in the conversation.

The snapshot is `nil` if you are not a participant in the conversation (including when the conversation doesn’t exist)

#### Parameters

**onSnapshot _(optional)_**: (@Sendable (\_ snapshot: \[[MessageSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Messages/#MessageSnapshot)\]?, \_ loadedAll: Bool) -> Void)?

Function called when the list of messages is updated

#### Returns

[MessageSubscription](https://talkjs.com/docs/Data_APIs/Swift/Messages/#MessageSubscription)

A subscription to messages.

### subscribeParticipants

func _conversationRef_.subscribeParticipants(onSnapshot:) -> [ParticipantSubscription](https://talkjs.com/docs/Data_APIs/Swift/Participants/#ParticipantSubscription)

Subscribes to the participants in the conversation.

While the subscription is active, `onSnapshot` will be called whenever the participant snapshots change. This includes when someone joins or leaves, when their participant attributes are edited, and when you load more participants. It also includes when nested data changes, such as when `snapshot[0].user.name` changes. `loadedAll` is true when `snapshot` contains all the participants in the conversation, and false if you could load more.

The `snapshot` list is ordered chronologically with the participants who joined most recently at the start. When someone joins the conversation, they will be added to the start of the list.

The snapshot is nil if you are not a participant in the conversation (including when the conversation doesn’t exist)

Initially, you will be subscribed to the 10 participants who joined most recently, and any new participants. Call `loadMore` to load additional older participants. This will trigger `onSnapshot`.

Remember to call `.unsubscribe` on the subscription once you are done with it.

#### Parameters

**onSnapshot _(optional)_**: (@Sendable (\_ snapshot: \[[ParticipantSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Participants/#ParticipantSnapshot)\]?, \_ loadedAll: Bool) -> Void)?

#### Returns

[ParticipantSubscription](https://talkjs.com/docs/Data_APIs/Swift/Participants/#ParticipantSubscription)

### subscribeTyping

func _conversationRef_.subscribeTyping(onSnapshot:) -> [TypingSubscription](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSubscription)

Subscribes to the typing status of the conversation.

Whenever `Subscription.state.type` is “active” and the typing status changes, `onSnapshot` will fire and `Subscription.state.latestSnapshot` will be updated. This includes changes to nested data, such as when a user who is typing changes their name.

The snapshot is nil if you are not a participant in the conversation (including when the conversation doesn’t exist)

Note that if there are “many” people typing and another person starts to type, `onSnapshot` will not be called. This is because your existing [TypingSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSnapshot) (with `many` set to `true`) is still valid and did not change when the new person started to type.

#### Parameters

**onSnapshot _(optional)_**: (@Sendable (\_ snapshot: [TypingSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSnapshot)?) -> Void)?

#### Returns

[TypingSubscription](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSubscription)

## struct ConversationSnapshot

A snapshot of a conversation’s attributes at a given moment in time.

### Properties

**createdAt**: Int64

The date that the conversation was created, as a unix timestamp in milliseconds.

**custom**: \[String : String\]

Custom metadata you have set on the conversation

**id**: String

The ID of the conversation

**joinedAt**: Int64

The date that the current user joined the conversation, as a unix timestamp in milliseconds.

**photoUrl _(optional)_**: String?

Contains the URL of a photo to represent the topic of the conversation or `nil` if the conversation does not have a photo specified.

**subject _(optional)_**: String?

Contains the conversation subject, or `nil` if the conversation does not have a subject specified.

**welcomeMessages**: \[String\]

One or more welcome messages that will be rendered at the start of this conversation as system messages.

Welcome messages are rendered in the UI as messages, but they are not real messages. This means they do not appear when you list messages using the REST API or JS/Kotlin/Swift Data API, and you cannot reply or react to them.

## struct ConversationSubscription

A subscription to a specific conversation.

### Method Overview

<table class="my-0"><tbody><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSubscription__unsubscribe" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">unsubscribe</a></td><td><p>Unsubscribe from this resource and stop receiving updates.</p></td></tr></tbody></table>

### Properties

**connected**: Deferred<[ConversationSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSubscriptionState)\>

Resolves when the subscription starts receiving updates from the server.

**state**: [ConversationSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSubscriptionState) { get }

The current state of the subscription

An enum with the following fields:

`type` is one of “pending”, “active”, “unsubscribed”, or “error”.

When `type` is “pending”, this property is ConversationSubscriptionState.pending.

When `type` is “active”, this property is ConversationSubscriptionState.active(latestSnapshot:).

When `type` is “unsubscribed”, this property is ConversationSubscriptionState.unsubscribed.

When `type` is “error”, this property is ConversationSubscriptionState.error(\_:).

**terminated**: Deferred<[ConversationSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSubscriptionState)\>

Resolves when the subscription permanently stops receiving updates from the server.

This is either because you unsubscribed or because the subscription encountered an unrecoverable error.

### unsubscribe

func _conversationSubscription_.unsubscribe()

Unsubscribe from this resource and stop receiving updates.

If the subscription is already in the ConversationSubscriptionState.unsubscribed or ConversationSubscriptionState.error(\_:) state, this is a no-op.

#### Returns

Void

## enum ConversationSubscriptionState

Values:

-   **pending**
-   **unsubscribed**
-   **active(latestSnapshot:)**
    
    The most recently received snapshot for the conversation, or `nil` if you are not a participant in the conversation (including when the conversation does not exist).
    
    **latestSnapshot _(optional)_**: [ConversationSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSnapshot)?
    
-   **error(\_:)**
    
    The error that caused the subscription to be terminated
    
    **\_ _(unnamed)_**: TalkJSError
    

## struct ConversationListSubscription

A subscription to your most recently active conversations.

### Method Overview

<table class="my-0"><tbody><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationListSubscription__loadMore" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">loadMore</a></td><td><p>Expand the window to include older conversations</p></td></tr><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationListSubscription__unsubscribe" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">unsubscribe</a></td><td><p>Unsubscribe from this resource and stop receiving updates.</p></td></tr></tbody></table>

### Properties

**connected**: Deferred<[ConversationListSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationListSubscriptionState)\>

Resolves when the subscription starts receiving updates from the server.

Wait for this promise if you want to perform some action as soon as the subscription is active.

The promise rejects if the subscription is terminated before it connects.

**state**: [ConversationListSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationListSubscriptionState) { get }

The current state of the subscription

An enum with the following fields:

`type` is one of “pending”, “active”, “unsubscribed”, or “error”.

When `type` is “pending”, this property is ConversationListSubscriptionState.pending.

When `type` is “active”, this property is ConversationListSubscriptionState.active(latestSnapshot:loadedAll:).

When `type` is “unsubscribed”, this property is ConversationListSubscriptionState.unsubscribed.

When `type` is “error”, this property is ConversationListSubscriptionState.error(\_:).

**terminated**: Deferred<[ConversationListSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationListSubscriptionState)\>

Resolves when the subscription permanently stops receiving updates from the server.

This is either because you unsubscribed or because the subscription encountered an unrecoverable error.

### loadMore

func _conversationListSubscription_.loadMore(count:) async

Expand the window to include older conversations

Calling `loadMore` multiple times in parallel will still only load one page of conversations.

Avoid calling `.loadMore` in a loop until you have loaded all conversations. This is usually unnecessary: any time a conversation receives a message, it appears at the start of the list of conversations. If you do need to call loadMore in a loop, make sure you set a small upper bound (e.g. 100) on the number of conversations, where the loop will exit.

#### Parameters

**count _(optional)_**: Int?

The number of additional conversations to load. Must be between 1 and 30. Default 20.

#### Returns

Void

### unsubscribe

func _conversationListSubscription_.unsubscribe()

Unsubscribe from this resource and stop receiving updates.

If the subscription is already in the ConversationListSubscriptionState.unsubscribed or ConversationListSubscriptionState.error(\_:) state, this is a no-op.

#### Returns

Void

## enum ConversationListSubscriptionState

Values:

-   **pending**
-   **unsubscribed**
-   **active(latestSnapshot:loadedAll:)**
    
    `latestSnapshot`: The most recently received snapshot for the conversations
    
    `loadedAll`: True if `latestSnapshot` contains all conversations you are in. Use [ConversationListSubscription.loadMore](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationListSubscription__loadMore) to load more.
    
    **latestSnapshot**: \[[ConversationSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#ConversationSnapshot)\]
    
    **loadedAll**: Bool
    
-   **error(\_:)**
    
    The error that caused the subscription to be terminated
    
    **\_ _(unnamed)_**: TalkJSError
    

## struct TypingSnapshot

A snapshot of the typing indicators in a conversation at a given moment in time.

### Properties

**many**: Bool

Check this to differentiate between few people are typing (`false`) and many people are typing (`true`).

When `false`, you can see the list of users who are typing in the `users` property.

**users _(optional)_**: \[[UserSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Users/#UserSnapshot)\]?

The users who are currently typing in this conversation.

The list is in chronological order, starting with the users who have been typing the longest. The current user is never contained in the list, only other users. When the `many` property is `true`, this property is `nil`.

## struct TypingSubscription

A subscription to the typing status in a specific conversation

### Method Overview

<table class="my-0"><tbody><tr class="flex flex-col flex-no-wrap sm:table-row"><td><a href="https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSubscription__unsubscribe" class="no-underline font-mono text-blue-500 hover:text-blue-600 font-medium">unsubscribe</a></td><td><p>Unsubscribe from this resource and stop receiving updates.</p></td></tr></tbody></table>

### Properties

**connected**: Deferred<[TypingSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSubscriptionState)\>

Resolves when the subscription starts receiving updates from the server.

Wait for this promise if you want to perform some action as soon as the subscription is active.

The promise rejects if the subscription is terminated before it connects.

**state**: [TypingSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSubscriptionState) { get }

The current state of the subscription

An enum with the following fields:

`type` is one of “pending”, “active”, “unsubscribed”, or “error”.

When `type` is “pending”, this property is TypingSubscriptionState.pending.

When `type` is “active”, this property is TypingSubscriptionState.active(latestSnapshot:).

When `type` is “unsubscribed”, this property is TypingSubscriptionState.unsubscribed.

When `type` is “error”, this property is TypingSubscriptionState.error(\_:).

**terminated**: Deferred<[TypingSubscriptionState](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSubscriptionState)\>

Resolves when the subscription permanently stops receiving updates from the server.

This is either because you unsubscribed or because the subscription encountered an unrecoverable error.

### unsubscribe

func _typingSubscription_.unsubscribe()

Unsubscribe from this resource and stop receiving updates.

If the subscription is already in the TypingSubscriptionState.unsubscribed or TypingSubscriptionState.error(\_:) state, this is a no-op.

#### Returns

Void

## enum TypingSubscriptionState

Values:

-   **pending**
-   **unsubscribed**
-   **active(latestSnapshot:)**
    
    The most recently received typing indicator snapshot, or `nil` if you are not a participant in the conversation (including when the conversation does not exist).
    
    **latestSnapshot _(optional)_**: [TypingSnapshot](https://talkjs.com/docs/Data_APIs/Swift/Conversations/#TypingSnapshot)?
    
-   **error(\_:)**
    
    The error that caused the subscription to be terminated
    
    **\_ _(unnamed)_**: TalkJSError
    

## enum ConversationAccess

Values:

-   **Read**
-   **ReadWrite**

## enum NotificationSettings

Values:

-   **True**
-   **False**
-   **MentionsOnly**
