You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,37 @@
1
1
# Changelog
2
+
3
+
# Unreleased
4
+
5
+
## Fixed
6
+
### Android
7
+
***Fixed FCM token refresh not being handled** - Added missing `onNewToken()` handler to `FcmInstanceIdListenerService`. Previously, when FCM automatically refreshed a device's push token (which can happen after extended inactivity, security updates, or OS updates), the app would not be notified of the new token. This caused push notifications to silently stop working for affected users because the backend was still sending to the old, invalid token.
8
+
9
+
## Added
10
+
### Android
11
+
***Added `isRefresh` property to token registration event** - The `Registered` event now includes an `isRefresh` boolean property (Android only) that indicates whether the token was received due to an FCM-initiated refresh (`true`) or from app initialization/manual refresh (`false`). This allows your backend to distinguish between initial registrations and token refreshes for analytics or debugging purposes.
12
+
13
+
**Important for client apps:** Ensure you register the `remoteNotificationsRegistered` event listener early in your app lifecycle (ideally in your root component constructor or `useEffect`). This listener will now be called whenever FCM refreshes the token, not just on initial registration. Your app should sync the new token to your backend each time this event fires.
Copy file name to clipboardExpand all lines: website/docs/docs/subscription.md
+77-2Lines changed: 77 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,18 @@ This section is about the first part of the flow.
10
10
11
11
In order to handle notifications, you must register the `remoteNotificationsRegistered` event beforehand.
12
12
13
+
## Important: Token Refresh Handling
14
+
15
+
:::caution Critical for Android
16
+
FCM (Firebase Cloud Messaging) can refresh the device token at any time, not just during initial registration. This happens when:
17
+
- The app is restored on a new device
18
+
- The user reinstalls the app
19
+
- The user clears app data
20
+
- FCM determines the token needs to be refreshed (e.g., after extended inactivity)
21
+
- Security-related token rotation
22
+
23
+
**Your app must always sync the token to your backend whenever `remoteNotificationsRegistered` fires**, not just the first time. Failure to do so will cause push notifications to silently stop working for affected users.
0 commit comments