Freigeben über


PushNotificationChannel.PushNotificationReceived Ereignis

Definition

Wird ausgelöst, wenn eine Pushbenachrichtigung auf diesem Kanal eingeht.

// 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) 

Ereignistyp

Windows-Anforderungen

App-Funktionen
internetClient

Beispiele

Das folgende Beispiel zeigt einen Listener für dieses Ereignis, der den Ereignishandler aufruft.

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

Hinweise

Windows Push Notification Services (WNS) sendet dieses Ereignis nur, wenn sich die Ziel-App der Benachrichtigung im Vordergrund befindet. Wenn die App angehalten ist, empfängt sie das -Ereignis nicht.

Gilt für:

Weitere Informationen