Push Token Repository
Component Detail
Data Layer
low complexity
Shared Component
backend
0
Dependencies
1
Dependents
2
Entities
0
Integrations
Description
Data access layer for the push_tokens table, managing the registration, refresh, and deregistration of device push tokens per user. Stores platform identifier (android/ios), the raw FCM registration token or APNs device token, and the last-refreshed timestamp. Shared with the Notification Settings feature for token lifecycle management.
push-token-repository
Responsibilities
- Persist new push tokens on successful FCM/APNs registration
- Update existing token when firebase_messaging triggers a token refresh
- Delete device token on user logout to prevent stale deliveries
- Retrieve all valid tokens for a given user across devices
Interfaces
upsertToken(userId, token, platform)
deleteToken(userId, token)
deleteAllTokensForUser(userId)
getTokensForUser(userId)
getTokensByPlatform(userId, platform)
Relationships
Related Data Entities (2)
Data entities managed by this component