The Notification payload is invalid(WNS)

Kyle Wang 10 Reputation points
2023-09-22T01:03:03.7733333+00:00

I follow the document to use azure console send toast message.

And get "The Notification payload is invalid" reponse.

(But choose "raw" type can successfully sent to the Push Notification System)

I didn't change the example.

What should I do to fix the problem?

Thanks.

User's image

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

2 answers

Sort by: Most helpful
  1. brtrach-MSFT 16,586 Reputation points Microsoft Employee
    2023-09-25T02:55:41.1533333+00:00

    @Kyle Wang It seems that you are facing an issue while sending a toast notification using Azure Notification Hubs. The error message "The Notification payload is invalid" indicates that the payload you are sending is not in the correct format.

    To resolve this issue, you can try the following steps:

    1. Make sure that you are using the correct XML format for the toast notification. You can refer to the following link for the correct format: https://docs.microsoft.com/windows/uwp/design/shell/tiles-and-notifications/toast-xml-schema
    2. Check if you have provided the correct values for the required fields in the XML payload, such as the text for the toast message.
    3. Verify that the package identity and publisher identity in the Package.appxmanifest file match the values in the Azure portal.
    4. Ensure that the notification payload is less than 5KB in size.

    If the issue persists, you can try sending a raw notification to see if it works. If it does, then the issue might be with the XML payload.


  2. Edward Lin 1 Reputation point
    2024-11-16T17:38:45.6766667+00:00

    @Kyle1 Wang(王雋凱) I have exact same symptom as you had when I use Test Send in Azure Notification Hub. Have you found the solution yet?

    Thanks!

    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.