From 2ca049d907ed17f9d37605162d11de91b7b76af9 Mon Sep 17 00:00:00 2001 From: drew batchelor Date: Fri, 9 Jul 2021 10:17:10 -0700 Subject: [PATCH] Adding explicit links to RequestAccessAsync methods Github issue #3221 - No link to explain how to obtain access to run background tasks --- .../shell/tiles-and-notifications/notification-listener.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hub/apps/design/shell/tiles-and-notifications/notification-listener.md b/hub/apps/design/shell/tiles-and-notifications/notification-listener.md index 17a71570a6..c704996897 100644 --- a/hub/apps/design/shell/tiles-and-notifications/notification-listener.md +++ b/hub/apps/design/shell/tiles-and-notifications/notification-listener.md @@ -177,7 +177,7 @@ listener.ClearNotifications(); A common way to enable an app to listen to notifications is to set up a background task, so that you can know when a notification was added or dismissed regardless of whether your app is currently running. -Thanks to the [single process model](/windows/uwp/launch-resume/create-and-register-an-inproc-background-task) added in the Anniversary Update, adding background tasks is fairly simple. In your main app's code, after you have obtained the user's access to Notification Listener and obtained access to run background tasks, simply register a new background task, and set the [UserNotificationChangedTrigger](/uwp/api/windows.applicationmodel.background.usernotificationchangedtrigger) using the [Toast notification kind](/uwp/api/windows.ui.notifications.notificationkinds). +Thanks to the [single process model](/windows/uwp/launch-resume/create-and-register-an-inproc-background-task) added in the Anniversary Update, adding background tasks is fairly simple. In your main app's code, after you have obtained the user's access to Notification Listener and obtained access to run background tasks by calling [UserNotificationListener.Current.RequestAccessAsync](/uwp/api/windows.ui.notifications.management.usernotificationlistener.requestaccessasync) and [BackgroundExecutionManager.RequestAccessAsync](/uwp/api/windows.applicationmodel.background.backgroundexecutionmanager.requestaccessasync) respectively, simply register a new background task, and set the [UserNotificationChangedTrigger](/uwp/api/windows.applicationmodel.background.usernotificationchangedtrigger) using the [Toast notification kind](/uwp/api/windows.ui.notifications.notificationkinds). ```csharp // TODO: Request/check Listener access via UserNotificationListener.Current.RequestAccessAsync