AppBroadcastBackgroundService.HeartbeatRequested Event

Definition

Raised by the system periodically to confirm that the broadcasting background task is currently active.

// Register
event_token HeartbeatRequested(TypedEventHandler<AppBroadcastBackgroundService, AppBroadcastHeartbeatRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void HeartbeatRequested(event_token const* cookie) const;

// Revoke with event_revoker
AppBroadcastBackgroundService::HeartbeatRequested_revoker HeartbeatRequested(auto_revoke_t, TypedEventHandler<AppBroadcastBackgroundService, AppBroadcastHeartbeatRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<AppBroadcastBackgroundService,AppBroadcastHeartbeatRequestedEventArgs> HeartbeatRequested;
function onHeartbeatRequested(eventArgs) { /* Your code */ }
appBroadcastBackgroundService.addEventListener("heartbeatrequested", onHeartbeatRequested);
appBroadcastBackgroundService.removeEventListener("heartbeatrequested", onHeartbeatRequested);
- or -
appBroadcastBackgroundService.onheartbeatrequested = onHeartbeatRequested;
Public Custom Event HeartbeatRequested As TypedEventHandler(Of AppBroadcastBackgroundService, AppBroadcastHeartbeatRequestedEventArgs) 

Event Type

Windows requirements

App capabilities
appBroadcast appBroadcastSettings

Remarks

Set the Handled property to true to confirm that the background task is currently active. Failure to respond to this event and set the Handled property to true can result in the background task for the broadcast app being terminated.

Applies to