Keep push notifications attached to the signed-in user
Section: DOC-CP-notifications-push#register-push-devices.
Keep a coaching update attached to the right person when a phone signs in, rotates its push token or switches accounts. Enroll the signed-in user’s device, send a test update, then remove that enrollment on sign-out.
Before starting, obtain the push token with the client SDK and the user’s device permission, and configure the matching delivery channel on your backend.
Recipe: receive an update on the signed-in device
Section: DOC-CP-notifications-push#push-device-registration.
Build the device enrollment part of a coaching-update notification. The device must be registered to the person who is signed in when it receives the notice—not to whoever last used the phone.
- Ask for device notification permission for the feature the user enabled, then obtain the current FCM token with the client SDK.
- Register that token under the signed-in user below. Keep it out of logs.
- Read registered channels and confirm push enrollment. If it is absent, repair registration before continuing. Then send a controlled test notice. Confirm it reaches the intended device, then test opening its destination.
- Keep registration current when the SDK rotates the token.
- On sign-out or account switch, remove the old user’s binding before registering the next user. Follow the recovery steps below if removal is uncertain.
Registration is setup; it does not prove provider delivery or that the device displayed a notice.
Register after sign-in or token rotation
Section: DOC-CP-notifications-push#register-a-device.
Request example: Register a push notification device · Request fields.
{
"fcmToken": "firebase-cloud-messaging-token",
"platform": "PLATFORM_IOS",
"deviceId": "device-unique-id"
}
Response:
Response example: Register a push notification device · Response fields.
{
"subscriberId": "user_123",
"success": true
}
Check enrollment before testing delivery
Section: DOC-CP-notifications-push#get-registered-channels.
Check which notification channels are available for the current user.
Request example: Get registered notification channels · Request fields.
{}
Response:
Response example: Get registered notification channels · Response fields.
{
"channels": [
{"channel": "CHANNEL_IN_APP", "registered": true, "credentialCount": 1},
{"channel": "CHANNEL_PUSH"},
{"channel": "CHANNEL_EMAIL", "registered": true, "credentialCount": 1},
{"channel": "CHANNEL_SMS"}
]
}
This example shows push enrollment is absent. Repair enrollment for the intended user and current device before sending a test; see registration fields. Registration alone does not prove delivery.
Remove this device before account switch
Section: DOC-CP-notifications-push#unregister-a-device.
Request example: Unregister a push notification device · Request fields.
{
"fcmToken": "firebase-cloud-messaging-token"
}
Response:
Response example: Unregister a push notification device · Response fields.
{
"subscriberId": "user_123"
}
Use the remaining-device result to confirm this device was removed.
Recover failed enrollment and sign-out
Section: DOC-CP-notifications-push#device-lifecycle.
Register while the intended user is authenticated. Listen for token rotation. After a reconnect or failed registration, check registered channels and retry the current token with a bounded retry policy instead of waiting for another rotation. Do not log push tokens.
Unregister the current device while the old user is still authenticated. If it fails, clear private data from the device, keep track of the pending removal, and retry under that user's authenticated session or ask support before binding the device to a different user. Signing out locally does not remove a server registration. Do not delete the user's persistent schedules when signing out one device.
A successful registration does not confirm delivery or display. Send a test to the device and check delivery status; receiving, displaying and opening a notification are separate outcomes. Device expiry rules differ by platform, so do not apply Android inactivity rules to iOS.
Document ID: DOC-CP-notifications-push. Section identities and revisions.