WNS : The Notification payload is invalid

Cem Karatas 0 Reputation points
2024-03-30T00:09:53.0133333+00:00

I am developing an app which highly relies on the WNS push notifications. However, except raw notifications, I get the following error for Tile,Badge and Toast

The Notification payload is invalid
The Notification payload is invalid

I also checked out community and it seems like there are some people had encountered the same error, then Microsoft engineers solved the issue. However, I could not find any way to solve it:

What I have done :

I used the toast draft provided by notification hub

I also tried other drafts provided by microsoft documentations.

I have set my UWP app manifest and channelUri retrieve function as described in the UWP app notifications article by Microsoft.

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.
263 questions
{count} votes

2 answers

Sort by: Most helpful
  1. VenkateshDodda-MSFT 18,436 Reputation points Microsoft Employee
    2024-04-17T06:43:23.5833333+00:00

    @Cem Karatas Thanks for your patience on this. I have checked with team and sharing the below.

    Upon investigating further, our team has identified a bug, a fix has been created and it will be get deployed in next few weeks.

    Also, note that the above-mentioned timeline is not exact ETA, and this might vary based on different factors.

    Meanwhile as workaround, instead of sending the notifications from portal try using the debug send Rest API with content type as text/xml.

    Hope this helps, let me know if you have any further questions on this.

    Please accept as Yes if the answer provided is useful , so that you can help others in the community looking for remediation for similar issues.

    0 comments No comments

  2. Louis Magdaleno 0 Reputation points Microsoft Employee
    2024-05-01T16:24:55.9066667+00:00

    Hi Cem,

    Please update your content-type header. It looks like you might be trying to use the direct send API and are providing an incorrect value for the content-type header.

    Here's a link to our direct send API documentation - https://learn.microsoft.com/en-us/rest/api/notificationhubs/direct-send

    Error from WNS:

    X-WNS-ERROR-DESCRIPTION: Incompatible ContentType application/xml. For X-WNS-Type = wns/toast, should be text/xml,application/json

    If you need further assistance, please create a support request through the Azure Portal so that we can see your specific resource details.

    0 comments No comments