Поделиться через


PushNotificationManager.PushReceived Событие

Определение

Возникает при получении платформой push-уведомления для приложения.

Примечание

Класс PushNotificationManager зависит от одноэлементного пакета. Из-за этой зависимости следует учитывать некоторые аспекты при вызове этих API из автономного приложения. Дополнительные сведения и особенности см. в разделе Зависимости от дополнительных пакетов MSIX.

// Register
event_token PushReceived(TypedEventHandler<PushNotificationManager, PushNotificationReceivedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
PushNotificationManager::PushReceived_revoker PushReceived(auto_revoke_t, TypedEventHandler<PushNotificationManager, PushNotificationReceivedEventArgs const&> const& handler) const;
public event TypedEventHandler<PushNotificationManager,PushNotificationReceivedEventArgs> PushReceived;
function onPushReceived(eventArgs) { /* Your code */ }
pushNotificationManager.addEventListener("pushreceived", onPushReceived);
pushNotificationManager.removeEventListener("pushreceived", onPushReceived);
- or -
pushNotificationManager.onpushreceived = onPushReceived;
Public Custom Event PushReceived As TypedEventHandler(Of PushNotificationManager, PushNotificationReceivedEventArgs) 

Тип события

Комментарии

Чтобы убедиться, что обработчик событий PushReceived вызывается в процессе запущенного приложения, перед вызовом register необходимо зарегистрировать обработчик для этого события. В противном случае для обработки уведомления будет запущен новый процесс.

Применяется к