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

Topic Lifecycle

When to Subscribe

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.