Hi @Anonymous ,
Firstly, addressing Erik’s findings regarding authentication. FCM has moved away from the legacy API key, and Azure Notification Hubs now requires using a service account JSON key for authentication instead. If you’re still using the old API key, ANH might appear to accept the request, but the notifications won’t actually be sent. Please check your Azure Notification Hub settings under Firebase (FCM) Configuration and make sure the correct OAuth 2.0 JSON key is uploaded.
One possible cause is that the FCM token stored in ANH may not be up-to-date. FCM tokens can change over time, and if ANH has an old token, it won’t be able to deliver the notification. You can check the current token in the app logs by running:
FirebaseMessaging.getInstance().getToken()
.addOnCompleteListener(task -> {
if (!task.isSuccessful()) {
Log.w("FCM", "Fetching FCM token failed", task.getException());
return;
}
Log.d("FCM", "FCM Token: " + task.getResult());
});
Then, compare it with the one registered in ANH using this command:
az notification-hub registration list --resource-group <resource-group> \
--namespace-name <namespace> --notification-hub-name <notification-hub>
If the tokens don’t match, the best approach is to re-register the device with the latest token.
Another thing to check is whether the notification is being sent to the correct target type. If you’re using direct device targeting, the payload should look like this:
{
"to": "<FCM-TOKEN>"
}
If you’re using tag-based targeting, Check the device registration includes the correct tag(s) and that the notification is being sent to those tags.
Additionally, Android’s Doze Mode and battery optimizations could be preventing notifications from being delivered, especially if the priority is set to normal. Try setting the priority to high in your payload:
{ "notification": { "title": "Test Notification", "body": "Hello from Azure Notification Hubs!" }, "android": { "priority": "high" } }
Hope it helps!
Please do not forget to click "Accept the answer” and Yes
wherever the information provided helps you, this can be beneficial to other community members.

If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.