Push notification in UWP after covert

Lucas 41 Reputation points
2019-11-08T03:57:45.06+00:00

I want to let my console app to use the push notification in UWP, so my team decide to covert our Console app to UWP. The question is how to implement the push notification after convert.
Thanks.

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Richard Zhang-MSFT 6,936 Reputation points
    2019-11-08T06:56:13.96+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    When preparing to add notifications to your app, you need to start support for the Windows 10 SDK for your app and add the necessary references, such as Windows.UI. In addition, you also need to register on the notification platform.

    The Desktop Bridge app and the classic Win32 app have some differences when it comes to notification registration.

    • For Desktop Bridge apps, you need to add Declaration for xmlns:com and xmlns:desktop to the package.appxmanifest file. For more settings, please refer to [here](https://learn.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/send-local-toast-desktop#step -5-register-with-notification-platform).
    • For classic Win32 apps, set up the AUMID so that you can send toasts, and then also specify a CLSID on your shortcut. This can be any random GUID. Don't add the COM server/activator. You're adding a "stub" COM CLSID, which will cause Action Center to persist the notification. Note that you can only use protocol activation toasts, as the stub CLSID will break activation of any other toast activations. Therefore, you have to update your app to support protocol activation, and have the toasts protocol activate your own app.

    Enable notification support for Win32 and Desktop Bridge apps, please refer to this document.

    ---

    If you are also interested in how to write notification content, you can read the following documents

    Thanks.


0 additional answers

Sort by: Most helpful

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.