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.

Feature: Push Notifications

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

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component