Hi @Shikhar Saxena,
Error Interpretation “Could not read notification body from the request” this is a known internal server error from ANH when the payload is invalid or not properly formatted for the platform you're targeting (like FCM for Android, APNs for iOS, etc.), especially if you're passing it directly to ANH. Also, an empty string in the url
field could be triggering a problem if the client app expects a valid URL.
Azure requires that the FCM payload strictly follow the format defined by Firebase. ANH does not automatically validate or fix the payload, so an incorrect structure immediately fails. Here’s how a valid FCM native payload for Notification Hubs looks:
{
"data": {
"message": "This notification does not include a URL"
},
"notification": {
"title": "Notification Without URL",
"body": "This notification does not include a URL"
}
}
If you're sending this payload using the Azure Notification Hubs SDK or REST API, you should make sure that you specify the format as application/json
and you wrap the above JSON string into a string payload (not object if using SDKs).
Also, if you’re targeting a specific platform (like FCM), the request must be structured accordingly. For example, using .SendFcmNativeNotificationAsync()
in .NET SDK or specifying Content-Type: application/json
in HTTP.
https://learn.microsoft.com/en-us/rest/api/notificationhubs/
https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-overview#platform-specific-payloads
Hope this information is helpful, if you have any further updates on this issue, please feel free to post back.