Getting bad request error in Windows push notifications using Windows App SDK

115 Views Asked by At

I have a win 32 style app which is purely in C++ and I was trying to use push notifications for Windows applications. As, these push notifications have the capability to start the app even when it is not running so was thinking to have this in application.

Now, many documentations are either UWP based, or C# based examples, but I have found this code and was thinking to try this out. I am following the same document, but I am facing few issues.

Reference: https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/notifications/push-notifications/push-quickstart

I am trying out this unpackaged one where Windows has provided this example, https://github.com/microsoft/WindowsAppSDK-Samples/blob/main/Samples/Notifications/Push/cpp-console-unpackaged/cpp-console-unpackaged.cpp

I was able to get the generated Azure app Id, was able to get the Channel URI, created a client secret and was trying to use POSTMAN app to send push notifications for my app.

Now, before sending any notifications we need to get the bearer access token, adding screenshot below of what I have added in the POSTMAN app. Why is it giving me a Bad Request error?

Edit: It says that as invalid client id so, it is giving me a bad request error.

enter image description here

Edit: Tried another from Internet, that POST Url should be https://login.microsoftonline.com/"PleaseAddTenantID"/oauth2/v2.0/token

Then error that I faced:

"error_description": "AADSTS500011: The resource principal named https://notify.windows.com was not found in the tenant named "XXX-XXX".

0

There are 0 best solutions below