NetworkOperatorDataUsageTrigger Class

Definition

Represents a trigger that launches a background task when the local data counters estimate that usage (bytes sent and received) on the mobile broadband interface has changed by an actionable threshold.

Note

This functionality is available only to mobile operator apps and UWP apps given privileged access by mobile network operators.

If you want to use this API and publish your app to the Microsoft Store, then you'll need special approval. For more information, see the Restricted capabilities section in the App capability declarations topic, and Mobile Broadband.

public ref class NetworkOperatorDataUsageTrigger sealed : IBackgroundTrigger
/// [Windows.Foundation.Metadata.Activatable(393216, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class NetworkOperatorDataUsageTrigger final : IBackgroundTrigger
[Windows.Foundation.Metadata.Activatable(393216, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class NetworkOperatorDataUsageTrigger : IBackgroundTrigger
function NetworkOperatorDataUsageTrigger()
Public NotInheritable Class NetworkOperatorDataUsageTrigger
Implements IBackgroundTrigger
Inheritance
Object Platform::Object IInspectable NetworkOperatorDataUsageTrigger
Attributes
Implements

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)
App capabilities
networkDataPlanProvisioning

Remarks

The trigger activates when the local data counters estimate that usage has changed by 5% since the last occurrence, except in these cases.

  1. If you're connected to a home network (non-roaming) and your data plan limit hasn't been specified, then this trigger activates at every 100 MB of local data usage.
  2. If you're connected to a roaming network, then your data plan limit doesn't apply and this trigger actives at every 5 MB of local data usage.

When this trigger activates, the IBackgroundTaskInstance.TriggerDetails for the background task is a NetworkOperatorDataUsageTriggerDetails instance.

NetworkOperatorDataUsageTrigger is the replacement for using NetworkOperatorNotificationTrigger and handling a DataPlanThresholdReached value for NetworkOperatorEventMessageType. You can register NetworkOperatorDataUsageTrigger by using standard background trigger idioms (see Register a background task), and it has the same prerequisites as NetworkOperatorNotificationTrigger. Your mobile operator app still needs to provision a data plan and set DataUsageInMobileOperatorNotificationEnabled to true. See Mobile operator notification event technical details for more details.

Constructors

NetworkOperatorDataUsageTrigger()

Initializes a new instance of a mobile network operator data usage trigger.

Note

This functionality is available only to mobile operator apps and UWP apps given privileged access by mobile network operators.

If you want to use this API and publish your app to the Microsoft Store, then you'll need special approval. For more information, see the Restricted capabilities section in the App capability declarations topic, and Mobile Broadband.

Applies to

See also