PushNotificationManager.PushReceived Evento

Definición

Se genera cuando la plataforma recibe una notificación de inserción para la aplicación.

Note

La clase PushNotificationManager tiene una dependencia en el paquete Singleton. Debido a esa dependencia, hay ciertas consideraciones que debe tener en cuenta si llama a estas API desde una aplicación independiente. Para obtener más información y detalles, consulta Dependencias en paquetes MSIX adicionales.

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

Comentarios

Para asegurarse de que se llama al controlador de eventos PushReceived dentro del proceso de la aplicación en ejecución, asegúrese de registrar el controlador para este evento antes de llamar a Register. De lo contrario, se producirá la siguiente excepción en tiempo de ejecución:

System.Runtime.InteropServices.COMException: Element not found. Must register event handlers before calling Register().

Se aplica a