Share via


UserNotificationListener Class

Definition

Reads and manages a user's notifications.

public ref class UserNotificationListener sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class UserNotificationListener final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class UserNotificationListener final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public sealed class UserNotificationListener
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class UserNotificationListener
Public NotInheritable Class UserNotificationListener
Inheritance
Object Platform::Object IInspectable UserNotificationListener
Attributes

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)

Remarks

UserNotificationListener requires explicit user permission to be granted before it may be used, so before attempting to access notifications be sure you call RequestAccessAsync from a UI-thread.

Properties

Current

Gets a UserNotificationListener for the current user.

Methods

ClearNotifications()

Clears the notification.

GetAccessStatus()

Gets a value that indicates whether the UserNotificationListener has access to the user's notifications.

GetNotification(UInt32)

Retrieves the specified notification.

GetNotificationsAsync(NotificationKinds)

Asynchronously retrieves notifications that match the specified notification kind.

RemoveNotification(UInt32)

Removes the specified notification.

RequestAccessAsync()

Requests the user's permission to manage notifications.

Events

NotificationChanged

Occurs when a notification is added or removed.

Applies to