I searched a lot but I didn't get any documentation or example that can help me to use PushNotificationTrigger in Background Task like we use SystemTrigger and TimeTrigger.
I want to receive the Toast Notifications when my app is closed. Notifications are coming to windows but don't know how to handle that in background. Anybody who had worked on PushNotifications in Universal windows app please provide some sample or document to handle the notifications.
This is I am getting in Lifecycle Events This is the code I am using to register the Task
if(!Windows.ApplicationModel.Background.BackgroundTaskRegistration.AllTasks.Any(i => i.Value.Name == "PushBackgroundTask"))
{
var result = await BackgroundExecutionManager.RequestAccessAsync();
var builder = new BackgroundTaskBuilder();
builder.Name = "PushBackgroundTask";
builder.TaskEntryPoint = typeof(NotificationActionBackgroundTask.NotificationActionBackgroundTask).FullName;
builder.SetTrigger(new Windows.ApplicationModel.Background.PushNotificationTrigger());
BackgroundTaskRegistration task = builder.Register();
}
Thanks
