-api-id | -api-type |
---|---|
T:Windows.Networking.PushNotifications.PushNotificationChannelManager |
winrt 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 secondary tile.
Windows version | SDK version | Value added |
---|---|---|
1607 | 14393 | GetForUser |
1703 | 15063 | GetDefault |
2004 | 19041 | ChannelsRevoked |
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.
})
PushNotificationChannel, Windows Push Notification Services (WNS) overview, Push and periodic notifications sample (archived), Quickstart: Sending a push notification, How to request, create, and save a notification channel, Push notification service request and response headers
internetClient