Azure Notification Hubs - Dropped Android FcmV1TemplateRegistration

Simone 5 Reputation points
2024-11-05T23:13:27.3566667+00:00

Using the this REST API to retrieve list of Android FcmV1 registered devices on Azure Notification Hub.

https://[my_namespace].servicebus.windows.net/[my_hub]/messages/?api-version=2015-01

Works perfectly, here is example of an FcmV1 registered device in the Notification Hub list;

i                   : http://www.w3.org/2001/XMLSchema-instance
xmlns               : http://schemas.microsoft.com/netservices/2010/10/servicebus/connect
ETag                : 1
ExpirationTime      : 2124-07-22T04:38:31.6331043Z
RegistrationId      : 4282634567123812146-7158421617157755944-2
Tags                : 1001011011011001
FcmV1RegistrationId : fdkyg1j9Tm6zlRrHQX3mGW:APA91bGU_...shortened...hpJK9txyzgjsz-IFyUIJ
BodyTemplate        : BodyTemplate
TemplateName        : TEAM

Devices self-register (more or less forever) and refresh using the Android SDK;

com.microsoft.azure:notification-hubs-android-sdk:2.0.0

Works perfectly, except... sometimes the registration disappears from the list.

Device won't get notifications if Notification Hub device registration not present.

When devices refresh their registration on App startup/open, they reappear in the list with the same ANH RegistrationId and FcmV1RegistrationId and get notifications again. The Registration Ids are persistent.

Normally, the App gets notifications regardless of whether it's in foreground, background or not even running.

ANH API happily continues to accept/send to the dropped registration. Of course, it gets nothing.

Don't think ANH tried to send the notification to Firebase. It can't without FcmV1RegistrationId, while no error is returned and process doesn't know it failed.

Previously, this behaviour was different with FB Gcm registration implementation, which threw an error if a valid GcmRegistrationId wasn't found.

Further, our direct Firebase HTTP v1 API (JWT) protocol successfully sends to devices that aren't registered on the Notification Hub, so the FcmV1RegistrationId is definitely valid.

Question: Anyone else having this problem and how can we be certain that FcmV1 registrations never get "dropped" by the Notification Hub..?

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
334 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 16,926 Reputation points Microsoft Employee
    2024-12-17T06:27:39.59+00:00

    @Simone From my understanding, it sounds like you're experiencing an issue with Azure Notification Hubs where FcmV1 registrations are intermittently disappearing. This can indeed disrupt the delivery of notifications to your Android devices. To address this, ensure that registrations are not expiring prematurely and implement logging to monitor the lifecycle of your registrations. Robust retry logic in your app can help re-register dropped registrations automatically.

    Please verify that you're using the latest version of the Azure Notification Hubs SDK and API, as updates often include important fixes. As a temporary workaround, consider sending critical notifications directly through Firebase to ensure they reach the devices even if the Notification Hub registration is dropped. If these steps don't resolve the issue, detailed logs and examples can help diagnose and address the problem more effectively.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.