PushNotificationChannelManagerForUser Classe

Définition

Crée des objets que vous utilisez pour récupérer des canaux de notification Push à partir de Windows Push Notification Services (WNS). Ces canaux sont liés à l’utilisateur actuel par le biais d’une application ou d’une vignette secondaire.

public ref class PushNotificationChannelManagerForUser sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PushNotificationChannelManagerForUser final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PushNotificationChannelManagerForUser final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PushNotificationChannelManagerForUser
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PushNotificationChannelManagerForUser
Public NotInheritable Class PushNotificationChannelManagerForUser
Héritage
Object Platform::Object IInspectable PushNotificationChannelManagerForUser
Attributs

Configuration requise pour Windows

Famille d’appareils
Windows 10 Anniversary Edition (introduit dans 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduit dans v3.0)

Exemples

L’exemple suivant montre l’utilisation de la méthode CreatePushNotificationChannelForApplicationAsync pour récupérer un canal de notification Push pour l’application appelante.

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

function openNotificationsChannel() {
    var channelOperation = pushNotifications.PushNotificationChannelManagerForUser.createPushNotificationChannelForApplicationAsync();
    return channelOperation.then(function (newChannel) {
        channel = newChannel;
    }
);

L’exemple suivant illustre l’utilisation de la méthode CreatePushNotificationChannelForSecondaryTileAsync pour récupérer un canal de notification Push pour une vignette secondaire.

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

pushNotifications.PushNotificationChannelManagerForUser.createPushNotificationChannelForSecondaryTileAsync(myTileId).then(function (channel) {
    // Your code here.
})

Remarques

Cette classe n’a pas de constructeur. Pour plus d’informations sur l’utilisation, consultez la section Exemples.

Historique des versions

Version de Windows Version du SDK Valeur ajoutée
1703 15063 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String)
1703 15063 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String,String)

Propriétés

User

Obtient l’utilisateur.

Méthodes

CreatePushNotificationChannelForApplicationAsync()

Crée un objet, lié à l’application appelante, via lequel vous récupérez un canal de notification Push à partir de Windows Push Notification Services (WNS).

CreatePushNotificationChannelForApplicationAsync(String)

Crée un objet, lié à une application spécifiée, par le biais duquel vous récupérez un canal de notification Push à partir de Windows Push Notification Services (WNS). L’application spécifiée doit se trouver dans le même package que l’application appelante.

CreatePushNotificationChannelForSecondaryTileAsync(String)

Crée un objet, lié à une vignette secondaire, via lequel vous récupérez un canal de notification Push à partir de Windows Push Notification Services (WNS). La vignette peut être une vignette secondaire de l’application appelante ou de toute autre application dans le même package.

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String)

Crée un objet lié à une application spécifiée via laquelle vous récupérez un canal de notification Push à partir de Windows Push Notification Services (WNS). L’application spécifiée doit se trouver dans le même package que l’application appelante.

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String)

Crée un objet lié à une application spécifiée via laquelle vous récupérez un canal de notification Push à partir de Windows Push Notification Services (WNS). L’application spécifiée doit se trouver dans le même package que l’application appelante.

S’applique à