다음을 통해 공유


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

설명

WNS(Windows 푸시 알림 서비스)는 알림의 대상 앱이 포그라운드에 있는 경우에만 이 이벤트를 보냅니다. 앱이 일시 중단된 경우 이벤트를 수신하지 않습니다.

적용 대상

추가 정보