PushNotificationChannel.PushNotificationReceived イベント

定義

このチャネルにプッシュ通知が到着したときに発生します。

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

イベントの種類

Windows の要件

アプリの機能
internetClient

次の例は、イベント ハンドラーを呼び出すこのイベントのリスナーを示しています。

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

注釈

Windows プッシュ通知サービス (WNS) は、通知のターゲット アプリがフォアグラウンドにある場合にのみ、このイベントを送信します。 アプリが中断されている場合、イベントは受信されません。

適用対象

こちらもご覧ください