Search code examples
notificationsuwptoast

UWP In-App Notifications (As opposed to Toast notifications)


On Android, toast notifications work differently to UWP. It simply shows a little black popup message over the top of the app. In UWP, toast notifications are indistinguishable from push notifications from the user perspective. Is there a standardized way in UWP to simply show a quick notification inside the app that will disappear after a few seconds and not interfere with the user's experience? I mean without it looking like the user has received a push notification?

This article doesn't seem to hint at anything like what I am talking about. https://learn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-badges-notifications


Solution

  • We ended up building something as part of our Xamarin UI library to handle this.

    The code can be found here: https://github.com/MelbourneDeveloper/Adapt.Presentation/blob/master/Adapt.Presentation.UWP/Adapt/Presentation/UWP/InAppNotification.xaml.cs

    There is a sample in this repo: https://github.com/MelbourneDeveloper/Adapt.Presentation.git

    Note: the same is for Xamarin Forms, but if you crack the code open, you'll be able to figure out how to use this for any UWP app.