-api-id | -api-type |
---|---|
T:Windows.Networking.PushNotifications.PushNotificationChannelManagerForUser |
winrt class |
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.
This class does not have a constructor. For more information about usage, see the examples section.
Windows version | SDK version | Value added |
---|---|---|
1703 | 15063 | CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String) |
1703 | 15063 | CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String,String) |
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.
})