PushNotificationChannel.PushNotificationReceived Événement

Définition

Déclenché lorsqu’une notification Push arrive sur ce canal.

// Register
event_token PushNotificationReceived(TypedEventHandler<PushNotificationChannel, PushNotificationReceivedEventArgs const&> const& handler) const;

// Revoke with event_token
void PushNotificationReceived(event_token const* cookie) const;

// Revoke with event_revoker
PushNotificationChannel::PushNotificationReceived_revoker PushNotificationReceived(auto_revoke_t, TypedEventHandler<PushNotificationChannel, PushNotificationReceivedEventArgs const&> const& handler) const;
public event TypedEventHandler<PushNotificationChannel,PushNotificationReceivedEventArgs> PushNotificationReceived;
function onPushNotificationReceived(eventArgs) { /* Your code */ }
pushNotificationChannel.addEventListener("pushnotificationreceived", onPushNotificationReceived);
pushNotificationChannel.removeEventListener("pushnotificationreceived", onPushNotificationReceived);
- or -
pushNotificationChannel.onpushnotificationreceived = onPushNotificationReceived;
Public Custom Event PushNotificationReceived As TypedEventHandler(Of PushNotificationChannel, PushNotificationReceivedEventArgs) 

Type d'événement

Configuration requise pour Windows

Fonctionnalités de l’application
internetClient

Exemples

L’exemple suivant montre un écouteur pour cet événement, qui appelle le gestionnaire d’événements.

function listeningForPushNotification() {
    if (channel) {
        channel.addEventListener("pushnotificationreceived", pushNotificationReceivedHandler);
}

Remarques

Windows Push Notification Services (WNS) envoie cet événement uniquement lorsque l’application cible de la notification se trouve au premier plan. Si l’application est suspendue, elle ne reçoit pas l’événement.

S’applique à

Voir aussi