PushNotificationManager.PushReceived 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当平台收到应用的推送通知时引发。
注意
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 之前为此事件注册处理程序。 否则,将启动一个新进程来处理通知。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈