PushNotificationChannelManager PushNotificationChannelManager PushNotificationChannelManager PushNotificationChannelManager Class

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 SecondaryTile.

Syntax

Declaration

public static class PushNotificationChannelManagerpublic static class PushNotificationChannelManagerPublic Static Class PushNotificationChannelManagerpublic static class PushNotificationChannelManager

Remarks

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(String) 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 summary

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

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.

Creates an object, bound to a SecondaryTile, 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.

Prerelease. Gets the manager for the active user.

Gets the push notifications for the specified 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 static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync()public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync()Public Static Function CreatePushNotificationChannelForApplicationAsync() As IAsyncOperation( Of PushNotificationChannel )public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync()

    Returns

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

    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(String).

    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;
    
        }
    
    );
    
  • 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. 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(String applicationId)public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync(String applicationId)Public Static Function CreatePushNotificationChannelForApplicationAsync(applicationId As String) As IAsyncOperation( Of PushNotificationChannel )public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForApplicationAsync(String applicationId)

    Parameters

    • applicationId
      System.String
      System.String
      System.String
      System.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).

    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(String).

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

    Creates an object, bound to a SecondaryTile, 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(String tileId)public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForSecondaryTileAsync(String tileId)Public Static Function CreatePushNotificationChannelForSecondaryTileAsync(tileId As String) As IAsyncOperation( Of PushNotificationChannel )public static IAsyncOperation<PushNotificationChannel> CreatePushNotificationChannelForSecondaryTileAsync(String tileId)

    Parameters

    • tileId
      System.String
      System.String
      System.String
      System.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.

    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.
    
    })
    
  • GetDefault()
    GetDefault()
    GetDefault()
    GetDefault()

    Prerelease. Gets the manager for the active user.

    public static PushNotificationChannelManagerForUser GetDefault()public static PushNotificationChannelManagerForUser GetDefault()Public Static Function GetDefault() As PushNotificationChannelManagerForUserpublic static PushNotificationChannelManagerForUser GetDefault()

    Returns

  • GetForUser(User)
    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 PushNotificationChannelManagerForUserpublic static PushNotificationChannelManagerForUser GetForUser(User user)

    Parameters

    Returns

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Capabilities

internetClient

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Networking.PushNotifications.dll