Push​Notification​Channel​Manager Push​Notification​Channel​Manager Push​Notification​Channel​Manager Class

Definition

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

public : static class PushNotificationChannelManagerpublic static class PushNotificationChannelManagerPublic Static Class PushNotificationChannelManager
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
internetClient

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.PushNotificationChannelManager.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.PushNotificationChannelManager.createPushNotificationChannelForSecondaryTileAsync(myTileId).then(function (channel) {
    // Your code here.
})

Methods

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 : static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync()public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync()Public Static Function CreatePushNotificationChannelForApplicationAsync() As IAsyncOperation( Of PushNotificationChannel )
Returns

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

Attributes

Examples

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



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


function openNotificationsChannel() {

    var channelOperation = pushNotifications.PushNotificationChannelManager.createPushNotificationChannelForApplicationAsync();

    return channelOperation.then(function (newChannel) {

        channel = newChannel;

    }

);

Remarks

Tile update, toast, and badge notifications that arrive on this channel are delivered to the app's main or default tile.

An exception is thrown if you attempt to register a WNS push notification channel when there is no data connection. For a list of error codes that can be received, see CreatePushNotificationChannelForApplicationAsync.

See Also

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. This overload should only be called from a multi-app package, most apps should use the method with no parameter.

public : static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync(PlatForm::String applicationId)public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync(String applicationId)Public Static Function CreatePushNotificationChannelForApplicationAsync(applicationId As String) As IAsyncOperation( Of PushNotificationChannel )
Parameters
applicationId
PlatForm::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).

Attributes

Remarks

Tile update, toast, and badge notifications that arrive on this channel are delivered to the app's main or default tile.

An exception is thrown if you attempt to register a WNS push notification channel when there is no data connection. For a list of error codes that can be received, see CreatePushNotificationChannelForApplicationAsync.

See Also

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 : static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForSecondaryTileAsync(PlatForm::String tileId)public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForSecondaryTileAsync(String tileId)Public Static Function CreatePushNotificationChannelForSecondaryTileAsync(tileId As String) As IAsyncOperation( Of PushNotificationChannel )
Parameters
tileId
PlatForm::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).

Attributes

Examples

This example shows the use of this method to retrieve a push notification channel for a secondary tile.



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


pushNotifications.PushNotificationChannelManager.createPushNotificationChannelForSecondaryTileAsync(myTileId).then(function (channel) {

    // Your code here.

})

Remarks

Note

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

See Also

GetDefault() GetDefault() GetDefault()

Gets the manager for the active user.

public : static PushNotificationChannelManagerForUser GetDefault()public static PushNotificationChannelManagerForUser GetDefault()Public Static Function GetDefault() As PushNotificationChannelManagerForUser
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)
Capabilities
internetClient

GetForUser(User) GetForUser(User) GetForUser(User)

Gets the push notifications for the specified user.

public : static PushNotificationChannelManagerForUser GetForUser(User user)public static PushNotificationChannelManagerForUser GetForUser(User user)Public Static Function GetForUser(user As User) As PushNotificationChannelManagerForUser
Parameters
user
User User User

The user account for the push notifications.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
Capabilities
internetClient

See Also