Overview
BrokerOS delivers low-latency push notifications to field agents and telecallers via Firebase Cloud Messaging (FCM v1) and Expo Notifications. Push notifications alert employees to high-priority operational events:- Fresh lead inquiries assigned by managers or ingested via Meta and Google Ads
- Escalated discount approvals and pricing waivers
- Daily morning follow-up call reminders
- Confirmed unit bookings and token deposit receipts
- Direct mentions and priority team chat messages
Notification Pipeline Architecture
Push Token Registration Lifecycle
When an employee opens the mobile app:- Permission Request: Expo Notifications requests notification runtime permissions (
POST_NOTIFICATIONSon Android 13+). - Token Generation: Expo registers with Firebase and retrieves a unique device push token.
- Database Association: The mobile client sends the token to
PATCH /api/users/push-token, saving it in PostgreSQL (User.pushToken). - Targeted Dispatch: Whenever system events affect that user, the BullMQ worker targets their specific hardware token.
Trigger Events & Notification Payloads
In-App Notification Center
In addition to background system banners, the mobile app includes an in-app notification center accessible via the bell icon in the dashboard header:- Live Counter: Unread badge count increments in real time via Socket.IO events (
new_notification). - Interactive Deep Linking: Tapping a notification navigates directly to the associated lead profile, booking agreement, or approval sheet.
Build Configuration: Firebase & FCM v1
Firebase is embedded at build time usingapps/mobile/google-services.json:
- Firebase Project: Register an Android application under the package name
com.anonymous.mobile(configured inapps/mobile/app.json). - Download File: Download
google-services.jsonand save it to theapps/mobile/root directory. - Expo Dashboard Credentials: In expo.dev, navigate to your project -> Credentials -> Android -> Push Credentials and upload your Google Service Account private key JSON for FCM v1 delivery.
- Compile Build: Run
npx expo run:androidor EAS build to embed the configuration into the native APK.