Device Token Invalid Event (v1)

Event emitted when a device token is invalid/expired

Emitted when a device token is determined to be invalid during push notification delivery. The event is produced by connector-notifications-push-fcm and consumed by notification-builder to maintain device-related projections. External consumers may also use this event to remove stale device registrations and keep device records up to date.

When is the event emitted?

When using the standard push notification capability based on Firebase Cloud Messaging (FCM), invalid device tokens are detected automatically during notification delivery.

A DeviceTokenInvalidated event is emitted when Firebase returns one of the following responses:

  • UNREGISTERED
  • SENDER_ID_MISMATCH
  • not a valid FCM registration token

The event is published to the notifications.event.device-token-invalid topic.

Note: The deviceId field in the notification payload is optional. If deviceId is not provided, the DeviceTokenInvalidated event is not emitted.

The event contains:

  • id - Unique event identifier
  • userId - Identifier of the user associated with the device
  • deviceId - Identifier of the device whose token was determined to be invalid

Architecture

Schema

Message Schema
{
"type": "record",
"name": "DeviceTokenInvalidated",
"namespace": "com.plumery.notifications.events",
"doc": "Event emitted when a user's device token is invalid.",
"fields": [
{
"name": "id",
"type": "string",
"doc": "Unique identifier for the event."
},
{
"name": "userId",
"type": "string",
"doc": "Identifier of the user that owns the device."
},
{
"name": "deviceId",
"type": "string",
"doc": "Identifier of the device that has invalid token."
}
]
}