Token deregistration
For push providers only, Knock provides an opt-in, provider-agnostic token management capability known as token deregistration. Knock removes invalid tokens from a recipient's corresponding channel data if that token results in a bounced
message on send.
This feature is available for all push providers, except OneSignal when the recipient mode is set to external_id
. In this case, Knock only has access to the user's ID and therefore cannot deregister the associated external token.
Workflow overrides are not available for token deregistration. This capability can only be configured at the provider level.
Availability
Provider | Token deregistration available? |
---|---|
APNS | ✅ |
FCM | ✅ |
Expo | ✅ |
OneSignal (player_id ) | ✅ |
OneSignal (external_id ) | ❌ |
Configuring Knock token deregistration
You can configure Knock tracking on a per-environment basis using your channel's per-environment configurations. Token deregistration will default to ON
when you first create a channel.
How it works
When Knock attempts to deliver a message through a supported push provider, any errors caused by invalid or expired tokens result in a bounce. This generates a message.bounced
event containing the invalid token.
Knock will remove the invalid token from the list of tokens present in the recipient's channel data. This allows for an automated audit of the tokens present for recipients.
Working with Knock token deregistration
Outbound webhooks
If you use Knock's outbound webhooks, you can view the invalid token in the message.bounced
events captured. If token deregistration is ON
, no further intervention is needed for token removal. See the outbound webhooks guide for more details.