Push Notification Service
Component Detail
Service Layer
high complexity
mobilebackend
1
Dependencies
1
Dependents
16
Entities
0
Integrations
Description
Orchestrates the full push notification lifecycle: registering and refreshing device tokens on login, constructing notification payloads server-side with deep-link data objects, dispatching notifications through the FCM/APNs adapter, and tracking delivery receipts. Handles foreground, background, and terminated-state message routing in Flutter via onMessage, onMessageOpenedApp, and onBackgroundMessage handlers.
push-notification-service
Responsibilities
- Register and refresh push tokens on login and token rotation events
- Construct notification payloads with entity_type and entity_id for deep-link routing
- Dispatch notifications to target devices via the FCM/APNs adapter
- Handle foreground, background, and terminated-state message reception in Flutter
- Track delivery status and update notification read state in database
Interfaces
registerPushToken(userId: String, token: String, platform: String)
refreshToken(oldToken: String, newToken: String)
deregisterToken(userId: String, deviceId: String)
sendNotification(userId: String, payload: NotificationPayload)
sendBulkNotifications(userIds: List<String>, payload: NotificationPayload)
handleForegroundMessage(message: RemoteMessage)
handleBackgroundMessage(message: RemoteMessage)
handleNotificationTap(message: RemoteMessage)
getNotificationHistory(userId: String, page: int, limit: int)
markNotificationRead(notificationId: String)
getUnreadCount(userId: String)
resolveDeepLink(entityType: String, entityId: String)
Relationships
Related Data Entities (16)
Data entities managed by this component
Achievement
16 fields
core
Event
19 fields
core
Notification
21 fields
core
Notification Setting
9 fields
configuration
Push Token
10 fields
core
Achievements
17 fields
core
Assignment Threshold Configs
18 fields
configuration
Assignments
27 fields
core
Certification Types
17 fields
configuration
Course Registrations
17 fields
core
Courses
24 fields
core
Event Registrations
14 fields
core
Events
27 fields
core
Notification Settings
17 fields
configuration
Notifications
24 fields
core
Push Tokens
11 fields
core