Based on your scenario description, I understand you are looking for automated/cleanup from Azure for stale registration. could you please provide more details about your requirement?
Yes, just to highlight: From this FCM doc - Best practices for FCM registration token management
- Stale registration tokens are associated with inactive devices that haven’t connected to the Firebase Cloud Messaging (FCM) service for over a month.
- When tokens reach 270 days of inactivity, FCM considers them expired and marks them as invalid.
- However, if a device connects again and the app is opened, FCM issues a new token for that app instance.
Does Notification Hubs detect uninstallation?
If you stored the device as a
Registration
, the first time you send to that registration and the PNS responds with an error status code that indicates the device is not valid, the device is deleted from your notification hub. If you stored your devices using theInstallation
APIs, they are not deleted in the scenario above. This decision was made to preserve tags and other metadata about a particular user that might be relevant if the user reinstalls. For both registrations and installations, you can set an expiration so that the device is automatically cleaned up at a given time. A common pattern is to have your client application update that expiration date once a day to move it back as long as the user is using your application.
Additionally, please checkout these discussion threads points from our PG -ANH removes the registration containing this invalid device from the backend.
If my answer helped (pointed, you in the right direction) > please click Accept Answer - it will benefit the community/users to find the answer quickly.