Three token types
The push system uses three distinct token types. Understanding which is which will save you debugging time at 2am.Multi-device support
A user can be signed in on multiple iOS devices simultaneously. Each device registers independently. Thedevices table uses deviceId (identifierForVendor) as the sort key — not the push token. This means:
- Each device gets its own record under the same userId
- Token rotation (OS updates, reinstalls) updates the existing record in-place
- No single-device enforcement — all devices receive pushes
identifierForVendor resets on app reinstall. When a user reinstalls, the old device record becomes orphaned. The 90-day TTL on lastSeenAt handles eventual cleanup, but there’s a window where both old and new records exist.Devices table schema
Registration flow on app launch
Every app launch triggers a registration call. This keeps tokens fresh and metadata current.1
Request permissions
On first launch, iOS shows the notification permission prompt. On subsequent launches, the app checks existing permission status.
2
Get device pushToken
If permissions are granted, iOS registers with APNs and returns the device push token. This token can change after OS updates.
3
POST /devices
The app sends
pushToken, deviceId, osVersion, and appVersion. The backend upserts the device record and refreshes lastSeenAt and ttl.4
Observe pushToStartToken
The app starts observing
Activity<ScorecardAttributes>.pushToStartTokenUpdates. When a token arrives, it’s sent via POST /devices/push-to-start-token.Unregistration on sign-out
When the user signs out:- iOS calls
DELETE /devices/:deviceId - Backend removes the device record from the
devicestable - Any active
live-activitiesrecords for this device are NOT automatically cleaned up (they’ll expire via TTL or get caught by the Orchestrator’s recovery loop) - iOS clears all local state
Failure modes
Key endpoints
Related pages
- Live Activity lifecycle — how push-to-start tokens are used to create LAs
- Match following — the flow that triggers update token registration
- Authentication flow — sign-in triggers device registration