Notifications
Update FCM Token Usage
Updates the lastUsed timestamp for an FCM token. Can be called periodically to track active devices.
Update FCM Token Usage
Documentation Index
Fetch the complete documentation index at: https://docs.traza.com.au/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Updates thelastUsed timestamp for an FCM token. This endpoint can be called periodically to track which devices are actively being used, enabling better token lifecycle management.
Use Cases
- Activity Tracking: Monitor which devices are actively in use
- Token Cleanup: Identify stale tokens that haven’t been used in a while
- Analytics: Track user engagement across multiple devices
- Token Management: Maintain accurate device activity records
When to Call
This endpoint is optional but recommended for:- App launch (update token usage on startup)
- Periodic background tasks (e.g., once per day)
- After receiving push notifications (device is active)
This endpoint is not required for basic FCM functionality. Registration and
removal are sufficient for most use cases.
Example Usage
Basic Usage
Using React Hook
Periodic Updates
Behavior
When token usage is updated:- Only the
lastUsedtimestamp is modified - Token itself and other metadata remain unchanged
- Operation is idempotent - safe to call frequently
- Fails silently if token doesn’t exist (returns success anyway)
Future Use Cases
ThelastUsed timestamp can be used for:
- Automatic Cleanup: Remove tokens not used in 90+ days
- Analytics Dashboard: Show active devices per user
- Security Monitoring: Detect unusual device activity
- User Notifications: Alert users about unrecognized devices
Related Endpoints
- Register FCM Token - Register device for notifications
- Remove FCM Token - Remove token on logout
See Also
- FCM Push Notifications Guide - Complete implementation guide
- Token Management Best Practices - Token lifecycle documentation
Body
application/json
Unique identifier for the device to update
Example:
"device_abc123"
Update FCM Token Usage