What a token is
A device token is an identifier issued by the platform that lets you push to one app install on one device. A user with three devices has three tokens.
Lifecycle
- The app registers a token at login and on launch.
- Tokens rotate when the OS reissues them, so the service must update mappings.
- Tokens expire when an app is uninstalled or unused for long.
Storage model
A store maps user to many tokens, each tagged with platform, app version, and last seen. Sending to a user fans out to all live tokens.
Pruning
Push gateways return feedback that a token is invalid. The service must remove those tokens promptly, or it wastes calls and hurts deliverability metrics.
Key idea
Token management maps users to many device tokens, updates rotations, and prunes dead tokens using gateway feedback.