Service Layer medium complexity backend
1
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Handles registration, update, and deregistration of FCM/APNs device tokens on behalf of the Flutter client. Called on login and whenever firebase_messaging reports a token rotation. Stores tokens with platform metadata (ios/android) and links them to the authenticated user.

Feature: Push Notifications

device-token-registration-service

Responsibilities

  • Register a new device token for the authenticated user on login
  • Update token when firebase_messaging fires onTokenRefresh
  • Deregister token on logout to prevent stale deliveries
  • Enforce one active token per device per user (upsert by device fingerprint)

Interfaces

registerToken(userId: string, token: string, platform: string, deviceId: string) → Promise<void>
refreshToken(userId: string, oldToken: string, newToken: string) → Promise<void>
deregisterToken(userId: string, deviceId: string) → Promise<void>

Relationships

Dependencies (1)

Components this component depends on

Related Data Entities (2)

Data entities managed by this component