Not able to send push notification from Azure Notification Hub after migrating to FCMv1 from FCM Legacy API

Akshay Chauhan 46 Reputation points
2024-09-12T14:42:09.1133333+00:00

I am updating my production service to use FCMv1 APIs instead of FCM legacy as they have been terminated by ANH. After updating I am sending test notification from azure portal from Notification Hub -> Test Send. I am able to send normal messages like below to mobile apps and which gets delivered successfully.

{
    "message": {
        "notification": {
            "title": "message title",
            "body": "message body"
        }
    }
}

But when I am sending notification in below format I am getting error on the portal that Notification payload is invalid.

This is the actual notification I was sending earlier in legacy API and was working fine. I need to send in this format only as to support multiple languages, template is stored in mobile. I just need to pass title and body args in the notification.

{
    "notification": {
        "title_loc_key": "test_title",
        "title_loc_args": [
            "abcd title"
        ],
        "body_loc_key": "test_body",
        "body_loc_args": [
            "Test body text"
        ]
    }
}

Screenshot 2024-09-12 200454

Its also not working when notification is pushed from code as well. I can't find any document which states if there is a different format for sending args in FCMv1. Please help me fix this issue.

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.
326 questions
0 comments No comments
{count} votes

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.