RawNotification RawNotification RawNotification RawNotification Class

Definition

Encapsulates the app-defined content of a raw notification (a push notification that does not involve UI). Its contents can be used in an app's background task, if the app has that capability, or otherwise consumed by the app and acted on as needed.

public : sealed class RawNotification : IRawNotification, IRawNotification2public sealed class RawNotification : IRawNotification, IRawNotification2Public NotInheritable Class RawNotification Implements IRawNotification, IRawNotification2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

A RawNotification object is obtained through the TriggerDetails property.

A background task that is intended to run in response to a notification must be registered with a PushNotificationTrigger. If it is not registered, the task will not run when a raw notification is received. For more info, see Raw notification overview.

Properties

ChannelId ChannelId ChannelId ChannelId

Gets the Channel ID of the raw notification.

public : PlatForm::String ChannelId { get; }public string ChannelId { get; }Public ReadOnly Property ChannelId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string that contains the app-defined Channel ID, as set by the app server.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

This is only valid for notifications sent over a channel created by CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync. If notification are sent over a channel created with CreatePushNotificationChannelForApplicationAsync, this will be null.

Content Content Content Content

Gets the content of the raw notification as a string. This string specifies a background task associated with the app.

public : PlatForm::String Content { get; }public string Content { get; }Public ReadOnly Property Content As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string that contains the app-defined notification content, as set by the app server.

See Also

Headers Headers Headers Headers

Gets the raw header content from the notification.

public : IMapView<string, string> Headers { get; }public IReadOnlyDictionary<string, string> Headers { get; }Public ReadOnly Property Headers As IReadOnlyDictionary<string, string>// You can use this property in JavaScript.
Value
IMapView<PlatForm::String, PlatForm::String> IReadOnlyDictionary<string, string> IReadOnlyDictionary<string, string> IReadOnlyDictionary<string, string>

A map view of the header values. See remarks for the header format.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

Header format:

Content-Encoding: aesgcm
Crypto-Key: dh=<PUBLICKEY>
Encryption: salt=<SALT>

For more information and to learn how headers are defined, see Message Encryption for Web Push, section 3.2.

The header content is for notifications sent using a channel created with CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync and pushed to WNS using the Webpush protocol with VAPID authentication. For any other type of push notification, the header value is null.

See Also