Following this MSD I have implemented WPS push notification support for my UWP application. In the case of Android, we have a
public override async void OnMessageReceived(RemoteMessage message)
method which is going to capture the pushed FCM notification and we are able to add Pending intents and have functionalities like navigating to a specific page on tap of a certain notification implemented. Likewise in the case of iOS, we have a
[Export("userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:")]
public void DidReceiveNotificationResponse(UNUserNotificationCenter center, UNNotificationResponse response, Action completionHandler)
to intercept any notification interaction from the user, such as taps, or action button interaction and handle them accordingly.
In UWP, we have a
toast.Activated
event, to which we can assign a handler to do whatever is it we want to achieve when the ToastNotification is interacted with.
Unfortunately, this requires me to actually create a ToastNotification to be able to assign an event handler to it.
But as stated in the Microsoft documentation, I need not have any method to intercept the push notification and create a ToastNotification. The Push notification banner is automatically displayed.
How do I capture the notification tapped by the user? As I will require to navigate to certain pages based on the notification tapped.