Skip to main content
Real-time events are MQTT topic subscriptions managed by the SDK. Subscribe to the smallest topic that matches the screen, and the SDK delivers matching changes into the live objects, live collections, and local caches you already observe.
Topic subscriptions do not replace Live Objects & Collections. Use subscriptions to tell the SDK which event streams matter now, then render from the live data APIs.

Platform Surface

AreaTypeScriptiOSAndroidFlutter
Social topicsTopic helper functions such as getCommunityTopic, getPostTopic, and subscribeTopicAmityTopic classes with AmityTopicSubscriptionModel .subscription(...) extensions plus AmityCoreClient.subscription(...) for follow topicsModel .subscription(...) extensions
Chat topicsgetSubChannelTopic(subChannel) with subscribeTopic(topic)AmitySubChannelTopic with AmityTopicSubscriptionsubChannel.subscription()subChannel.subscription()
UnsubscribeCall the Amity.Unsubscriber returned by subscribeTopicunsubscribeTopic(...)unsubscribeTopic()unsubscribeTopic()

Topic Lifecycle

When to Subscribe

UI needRecommended topic
Community profile or settings changesCommunity topic with community-level events
Community feed creation, deletion, or updatesCommunity topic with post events, or post-and-comment events for a full feed
A single post detail screenPost topic for the post, and comment events if comments are visible
A comment detail or moderation surfaceComment topic
A user profile screenUser topic with user-level events
A chat threadSubchannel topic
Follow/follower list changesFollow topic on platforms that expose follow topic helpers
Story updatesStory topic or community-story topic where available

Subscription Discipline

Topic APIs usually require an SDK model object such as AmityCommunity, AmityPost, AmityComment, AmityUser, or AmitySubChannel. Fetch or observe the model first, then subscribe while that model is visible.
A community feed usually needs one community post-and-comment topic, not a separate topic for every post row. Use post or comment topics for focused detail screens.
Unsubscribe when the screen is dismissed, the component unmounts, or the observed model changes. Logout also tears down the SDK session, but UI-level cleanup keeps each screen’s ownership clear.
A topic subscription activates event delivery. Your UI should still read from the SDK live object or live collection so cache updates, loading state, and error handling stay consistent.

Social Real-time Events

Subscribe to community, post, comment, user, follow, and story topics.

Chat Real-time Events

Subscribe to subchannel topics for chat thread updates.

Live Objects & Collections

Observe SDK-managed live data after subscribing to the event streams your UI needs.