PushNotificationManager.PushReceived 事件

定义

当平台收到应用的推送通知时引发。

注意

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 之前为此事件注册处理程序。 否则,将启动一个新进程来处理通知。

适用于