PushNotificationManager.PushReceived 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當平臺收到應用程式的推播通知時引發。
注意
PushNotificationManager類別相依于Singleton 套件。 由於該相依性,如果您要從 獨立應用程式呼叫這些 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。 否則,將會啟動新的進程來處理通知。