Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 2.24 KB

pushnotificationchannelmanagerforuser.md

File metadata and controls

55 lines (38 loc) · 2.24 KB
-api-id -api-type
T:Windows.Networking.PushNotifications.PushNotificationChannelManagerForUser
winrt class

Windows.Networking.PushNotifications.PushNotificationChannelManagerForUser

-description

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.

-remarks

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

Version history

Windows version SDK version Value added
1703 15063 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String)
1703 15063 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String,String)

-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.
})

-see-also