Chat real-time events enable live updates for messaging features through topic subscriptions. A topic is a unique path constructed for each model you wish to receive real-time updates about, with helper methods provided for each model type.
For conversation and community channels, real-time events are automatic for channel members. However, live channels still need to be established. To receive updates from a channel, users must have ‘Member’ status. Leaving a channel automatically stops event delivery.

Subchannel Topic

Subscribe to subchannel events for real-time messaging updates:
// Create Topic
let topic = AmitySubChannelTopic(subChannel: subChannel)

// Subscribe to it
let topicSubscription = AmityTopicSubscription(client: client)
topicSubscription.subscribeTopic(topic) { success, error in
    // Handle subscription result
}

// Unsubscribe it
topicSubscription.unsubscribeTopic(topic) { success, error in
    // Handle unsubscription result
}