PushNotificationReceivedEventArgs PushNotificationReceivedEventArgs PushNotificationReceivedEventArgs PushNotificationReceivedEventArgs PushNotificationReceivedEventArgs Class


Encapsulates a push notification that has been received from the app server, identifying the type and supplying the content of the notification. Windows passes this information in the PushNotificationReceived event.

public : sealed class PushNotificationReceivedEventArgs
struct winrt::Windows::Networking::PushNotifications::PushNotificationReceivedEventArgs
public sealed class PushNotificationReceivedEventArgs
Public NotInheritable Class PushNotificationReceivedEventArgs
// This class does not provide a public constructor.

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


The following example shows the members of this class in use.

function listeningForPushNotification() {
    if (channel) {
        channel.addEventListener("pushnotificationreceived", pushNotificationReceivedHandler);

function pushNotificationReceivedHandler(e) {
    var notificationTypeName = "";
    var notificationPayload;
    switch (e.notificationType) {
        // You can get the toast, tile, or badge notification object.
        // In this example, we take the XML from the notification.
        case pushNotifications.PushNotificationType.toast:
            notificationTypeName = "Toast";
            notificationPayload = e.toastNotification.content.getXml();
        case pushNotifications.PushNotificationType.tile:
            notificationTypeName = "Tile";
            notificationPayload = e.tileNotification.content.getXml();
        case pushNotifications.PushNotificationType.badge:
            notificationTypeName = "Badge";
            notificationPayload = e.badgeNotification.content.getXml();
    e.cancel = true;


Your app receives this class when processing the PushNotificationReceived event.


BadgeNotification BadgeNotification BadgeNotification BadgeNotification BadgeNotification

Gets the content of a badge update to perform in response to this push notification.

Cancel Cancel Cancel Cancel Cancel

Gets or sets whether Windows should perform its default handling of the notification.

NotificationType NotificationType NotificationType NotificationType NotificationType

Gets the type of push notification that has been received from the app server.

RawNotification RawNotification RawNotification RawNotification RawNotification

Gets the app-defined content contained in this push notification, the contents of which are used to perform a background task on the app.

TileNotification TileNotification TileNotification TileNotification TileNotification

Gets the content of a tile update to perform in response to this push notification.

ToastNotification ToastNotification ToastNotification ToastNotification ToastNotification

Gets the content of a toast to display in response to this push notification.

See also