PushNotificationChannelManagerForUser PushNotificationChannelManagerForUser PushNotificationChannelManagerForUser PushNotificationChannelManagerForUser Class

Definition

Creates objects that you use to retrieve push notification channels from the Windows Push Notification Services (WNS). These channels are bound to the current user through an app or secondary tile.

public : sealed class PushNotificationChannelManagerForUser : IPushNotificationChannelManagerForUser, IPushNotificationChannelManagerForUser2public sealed class PushNotificationChannelManagerForUser : IPushNotificationChannelManagerForUser, IPushNotificationChannelManagerForUser2Public NotInheritable Class PushNotificationChannelManagerForUser Implements IPushNotificationChannelManagerForUser, IPushNotificationChannelManagerForUser2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Examples

The following example shows the use of the CreatePushNotificationChannelForApplicationAsync method to retrieve a push notification channel for the calling app.


var pushNotifications = Windows.Networking.PushNotifications;
var channel;

function openNotificationsChannel() {
    var channelOperation = pushNotifications.PushNotificationChannelManagerForUser.createPushNotificationChannelForApplicationAsync();
    return channelOperation.then(function (newChannel) {
        channel = newChannel;
    }
);

The following example shows the use of the CreatePushNotificationChannelForSecondaryTileAsync method to retrieve a push notification channel for a secondary tile.


var pushNotifications = Windows.Networking.PushNotifications;
var channel;

pushNotifications.PushNotificationChannelManagerForUser.createPushNotificationChannelForSecondaryTileAsync(myTileId).then(function (channel) {
    // Your code here.
})

Remarks

This class does not have a constructor. For more information about usage, see the examples section.

Properties

User User User User

Gets the user.

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

The user.

Methods

CreatePushNotificationChannelForApplicationAsync() CreatePushNotificationChannelForApplicationAsync() CreatePushNotificationChannelForApplicationAsync() CreatePushNotificationChannelForApplicationAsync()

Creates an object, bound to the calling app, through which you retrieve a push notification channel from Windows Push Notification Services (WNS).

public : IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync()public IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync()Public Function CreatePushNotificationChannelForApplicationAsync() As IAsyncOperation( Of PushNotificationChannel )// You can use this method in JavaScript.
Returns
See Also

CreatePushNotificationChannelForApplicationAsync(String) CreatePushNotificationChannelForApplicationAsync(String) CreatePushNotificationChannelForApplicationAsync(String) CreatePushNotificationChannelForApplicationAsync(String)

Creates an object, bound to a specified app, through which you retrieve a push notification channel from Windows Push Notification Services (WNS). The specified app must be in the same package as the calling app.

public : IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync(PlatForm::String applicationId)public IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync(String applicationId)Public Function CreatePushNotificationChannelForApplicationAsync(applicationId As String) As IAsyncOperation( Of PushNotificationChannel )// You can use this method in JavaScript.
Parameters
applicationId
PlatForm::String String String String

The Package Relative Application ID (PRAID) of the app to bind to the push notification channel.

Returns

The object, bound to the app specified in applicationId, that is used to request a PushNotificationChannel from the Windows Push Notification Services (WNS).

See Also

CreatePushNotificationChannelForSecondaryTileAsync(String) CreatePushNotificationChannelForSecondaryTileAsync(String) CreatePushNotificationChannelForSecondaryTileAsync(String) CreatePushNotificationChannelForSecondaryTileAsync(String)

Creates an object, bound to a secondary tile, through which you retrieve a push notification channel from Windows Push Notification Services (WNS). The tile can be a secondary tile of the calling app or any other app in the same package.

public : IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForSecondaryTileAsync(PlatForm::String tileId)public IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForSecondaryTileAsync(String tileId)Public Function CreatePushNotificationChannelForSecondaryTileAsync(tileId As String) As IAsyncOperation( Of PushNotificationChannel )// You can use this method in JavaScript.
Parameters
tileId
PlatForm::String String String String

The ID of the secondary tile to bind to the push notification channel.

Returns

The object, bound to the secondary tile, that is used to request a PushNotificationChannel from the Windows Push Notification Services (WNS).

Remarks

Note

Channels bound to secondary tiles only accept push notifications for Tile and Badge update types.

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String) CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String) CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String) CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String)

Creates an object bound to a specified app through which you retrieve a push notificaiton channel from Windows Push Notification Services (WNS). The specified app must be in the same package as the calling app.

public : IAsyncOperation<PushNotificationChannel> CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer appServerKey, PlatForm::String channelId)public IAsyncOperation<PushNotificationChannel> CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer appServerKey, String channelId)Public Function CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(appServerKey As IBuffer, channelId As String) As IAsyncOperation( Of PushNotificationChannel )// You can use this method in JavaScript.
Parameters
appServerKey
IBuffer IBuffer IBuffer IBuffer

An uncompressed key in ANSI X9.62 format. This value is from the P-256 curve defined in the Secure Hash Standard specification.

channelId
PlatForm::String String String String

The ID of the push notification channel.

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

Remarks

Note that all raw notifications sent over this channel will have the channelID attached before being delivered to the app. This allows for apps to create multiple channels and differentiate where the notifications come from.

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String) CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String) CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String) CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String)

Creates an object bound to a specified app through which you retrieve a push notificaiton channel from Windows Push Notification Services (WNS). The specified app must be in the same package as the calling app.

public : IAsyncOperation<PushNotificationChannel> CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer appServerKey, PlatForm::String channelId, PlatForm::String appId)public IAsyncOperation<PushNotificationChannel> CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer appServerKey, String channelId, String appId)Public Function CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(appServerKey As IBuffer, channelId As String, appId As String) As IAsyncOperation( Of PushNotificationChannel )// You can use this method in JavaScript.
Parameters
appServerKey
IBuffer IBuffer IBuffer IBuffer

An uncompressed key in ANSI X9.62 format. This value is from the P-256 curve defined in the Secure Hash Standard specification.

channelId
PlatForm::String String String String

The ID of the push notification channel.

appId
PlatForm::String String String String

The Package Relative Application ID of the app to bind to the push notification channel.

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

Remarks

All raw notifications sent over this channel will have the channelID attached before being delivered to the app. This allows for apps to create multiple channels and differentiate where the notifications come from.

Note

Most applications (including all third party apps) should use the CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync without the appID parameter.