Share via


PushNotificationManager.PushReceived Evento

Definição

Gerado quando uma notificação por push para o aplicativo é recebida pela plataforma.

Observação

A classe PushNotificationManager tem uma dependência no pacote Singleton. Devido a essa dependência, há certas considerações a serem consideradas se você estiver chamando essas APIs de um aplicativo autossuficiente. Para obter mais informações e detalhes, consulte Dependências de pacotes MSIX adicionais.

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

Tipo de evento

Comentários

Para garantir que o manipulador de eventos PushReceived seja chamado dentro do processo do aplicativo em execução, registre o manipulador para esse evento antes de chamar Register. Caso contrário, um novo processo será iniciado para lidar com a notificação.

Aplica-se a