uwpwin-universal-apptoastazure-notificationhubwns

UWP UserNotification from Chrome - how to get source domain info?


In my UWP app, when getting toast notifications from google services such as Gmail or Calendar, I can see the FQDN reflected within notification UI: see toast notifications I am getting

However, I can't find this domain information anywhere in the UserNotification object I am getting from await UserNotificationListener.Current.GetNotificationsAsync(NotificationKinds.Toast).

The UserNotification object is good and dandy but it seems to lack some pieces of info that I need, the FQDN being one of them. Where can I retrieve the FQDN from?

P.S. Other stuff I lack in the UserNotification object is:

My main painpoint is the lack of FQDN but if anyone knows how/whether I can retrieve the above mentioned, I'd be much obliged.


Solution

  • Based on Toast Notification format described here and here, the domain info is supplied as so called "Attribution Text". According to documentation:

    New in Anniversary Update: If you need to reference the source of your content, you can use attribution text. This text is always displayed at the bottom of your notification, along with your app's identity or the notification's timestamp.

    So, attribution text is what I am after. But despite being part of Toast Visual generic bindings, it doesn't seem to be available via the NotificationListener.

    ...It's been some 15 years since I last coded and now that I am getting back to it, I see that Microsoft didn't change its habbits.