Use this file to discover all available pages before exploring further.
SDK v7.x · Last verified March 2026 · iOS · Android · Web · Flutter
Speed run — just the code
// 1. Get notification tray itemsconst { data } = await notificationTray.getNotificationTrayItems({ limit: 20 });// 2. Mark a notification as seenawait notificationTray.markSeen('notificationId');// 3. Register push tokenawait Client.registerPushNotification({ token: 'fcm-or-apns-token', platform: 'android',});// 4. Subscribe to real-time eventsClient.onNotification((event) => { showBadge(event.unreadCount);});
Full walkthrough below ↓
Platform note — code samples below use TypeScript. Every method has an equivalent in the iOS (Swift), Android (Kotlin), and Flutter (Dart) SDKs — see the linked SDK reference in each step.
Notifications are your primary re-engagement tool. This guide covers building an in-app notification tray with seen/unseen tracking, setting up push notifications across all platforms, and subscribing to real-time social events.
Prerequisites: SDK installed and authenticated. For push notifications: APNs certificate (iOS) or FCM credentials (Android) configured in Admin Console → Settings → Integrations.Also recommended: Complete Build a Social Feed and Community Platform first — notifications are triggered by feed and community events.
After completing this guide you’ll have:
An in-app notification tray with seen/unseen state and real-time delivery
Push notifications (APNs and FCM) registered and firing for key events
Notification triggers mapped to SDK events and webhook callbacks
When the user opens the tray, mark all unseen items as seen. Or mark individual items as seen on tap. Both bulk and per-item marking are supported.
TypeScript
import { notificationTray } from '@amityco/ts-sdk';// Mark all as seenawait notificationTray.markAllNotificationTrayItemsAsSeen();// Or mark a single itemawait item.markSeen();
Each notification item contains targetType and targetId fields you can use to deep-link to the source content (post, comment, user, or community).Reference all notification types → Notification Events Reference
After the user logs in, retrieve the device token and register it with the SDK. This associates the device with the authenticated user so the backend can route pushes correctly.
import { Client } from '@amityco/ts-sdk';// Register a device token (web push or React Native FCM token)await client.registerPushNotification({ token: deviceToken });
Let users control what they’re notified about at a granular level. Settings are organised by module (SOCIAL, CHAT, LIVE_STREAM) and apply across all of the user’s devices.
1
Get current notification settings
Read the user’s current preferences to populate a settings screen.
For finer control, users can configure which notification types they receive per community (new post, new comment, mentions). This is separate from the global user setting above.Full reference → Community Notification Settings
Webhook: trigger notifications for moderation actions
When a moderator removes content, use webhook events (post.deleted, user.banned) to send a custom in-app or push notification explaining the action to the affected user.→ Webhook Events
Notification analytics
Track notification open rates and click-through rates in Admin Console → Analytics Dashboard → Engagement Metrics to understand which notification types drive the most re-engagement.
Polling for notifications on a timer — This drains battery and creates unnecessary API calls. Use real-time event subscriptions with Client.onNotification() instead.
// ❌ Bad — polling every 5 secondssetInterval(() => fetchNotifications(), 5000);// ✅ Good — real-time subscriptionClient.onNotification((event) => { updateBadge(event.unreadCount);});
Not handling push permission rejection — On iOS, users can deny push permissions. Always check the permission status and provide an in-app fallback (notification tray) when push is disabled.
Registering push tokens before login — Push token registration requires an active session. Always call registerPushNotification after login() completes, not in parallel.
Provide granular opt-out: users should be able to mute a specific community without turning off all notifications
Rate-limit push if a post gets hundreds of reactions — send “50+ reactions on your post” not one push per reaction
Dive deeper: Discovery & Engagement API Reference has full parameter tables, method signatures, and platform-specific details for every API used in this guide.