Windows.ApplicationModel.Background Windows.ApplicationModel.Background Windows.ApplicationModel.Background Windows.ApplicationModel.Background Namespace

Enables an app to schedule background tasks to run app code even when the app is suspended.

Background tasks are intended for small work items that do not require user interaction. Scenarios that are appropriate for background tasks include downloading mail, showing a toast notification for an incoming chat message, or reacting to a change in a system condition.

See Supporting your app with background tasks ( using JavaScript and HTML) or Support your app with background tasks for guidance on implementing background tasks. For a general overview of background tasks in Windows Store app, see the Introduction to Background Tasks whitepaper. For example code that shows how to implement background tasks, see the Background Task Sample.

Classes

Represents a trigger that is activated when the ActivitySensor receives input. This is used when your application needs to respond to the activity sensor.

Requests permission from the user to set alarms, and retrieves the status of user permission for the app to set alarms.

Prerelease. Represents an event that triggers a background task to run when an application starts gameplay broadcasting.

Prerelease. Provides information about the application that is broadcasting gameplay such as its logo, display name, and video characteristics.

This allows you to programmatically trigger a background tasks from within your application.

The details of an ApplicationTrigger.

Represents a trigger that launches a background task for processing changes to the appointment store.

Manage permission to run background tasks.

Represents a background task to be registered with the system.

Note

Starting in Windows 8.1, the parameters used to register the background task are validated at the time the task is registered. See the remarks for Register().

Represents completion information for a task at the time a completion notification is sent.

Represents a background task deferral returned by the GetDeferral() method.

Represents progress information for a task at the time a progress update notification is sent.

Represents a background task that has been registered with the system.

Retrieves a hint about resource availability for background tasks. Background tasks can use this hint to decide how much work to do when they are activated.

Represents a trigger that is registered to advertise a Bluetooth LE advertisement in the background.

Represents a trigger that is registered to scan for Bluetooth LE advertisement in the background.

Represents a trigger that launches a background task to enable the Cached File Updater contract.

Provides details about the cached file operation that invoked the trigger.

Represents a trigger that is activated when there is a notification for a text message.

Represents a trigger that launches a background task that handles any incoming message that might need to be filtered according to its content. For more information about filtering messages, see Windows.ApplicationModel.CommunicationBlocking.

Represents a trigger to activate a communication blocking application when it is selected as the preferred blocking app.

A user can have multiple communication blocking applications installed at one time. This trigger is used to let an application know that it has been selected as the active communication blocking application. For more information about the communication blocking API, see Windows.ApplicationModel.CommunicationBlocking.

Represents a trigger that launches a background task for processing changes to the contacts store.

Provides the ability to run custom handlers when prefetching web resources.

Represents a trigger that launches a background task when the connection status of a device changes.

Represents a trigger that launches a background task to enable device manufacturer operations.

Represents an event that an application can trigger to initiate a long-running update (firmware or settings) of a device.

Windows 8.1 enables you to develop Windows Store app for your peripheral devices that communicate over USB, HID, and Bluetooth. For example, a user might need to sync content on a PC to or from the device, or perform a long-running update to the device itself like settings or firmware updates. Windows 8.1 provides two background tasks and corresponding APIs that allow your device to sync and update in the background: DeviceServicingTrigger and DeviceUseTrigger. This topic provides API reference information for DeviceServicingTrigger - for info on using this trigger in the context of a device app, see Device sync and update for Windows Store device apps.

The DeviceServicingTrigger background task allows your Windows Store app that interacts with your peripheral device to perform long running device updates while your app is suspended, for example settings transfers or firmware updates. Updating your device in the background requires user approval each time the background task is used. Unlike the DeviceUseTrigger background task, the DeviceServicingTrigger background task allows for device reboot and disconnect and allows a maximum of 30 minutes of background activity.

Represents an event that a Windows Runtime app can trigger to initiate a long-running operation with a device or sensor.

DeviceUseTrigger lets your Windows Runtime app access sensors and peripheral devices in the background, even when your foreground app is suspended. For example, depending on where your app is running, it could use a background task to synchronize data with devices or monitor sensors.

This class can be used in Windows Store app and Windows Phone Store app. However, a DeviceUseTrigger background task supports different APIs, and is subject to different policies, depending where it's running (PC or phone). To learn more about these differences, see Accessing sensors and devices from a background task.

Important

This trigger cannot be used with single-process background tasks.

For a sample that shows how to use DeviceUseTrigger on a PC, see the Custom USB device sample. For a phone sample, see the Background Sensors sample.

Represents an event that causes a background task to run when changes occur to the list of devices. Returned by GetBackgroundTrigger(Windows.Foundation.Collections.IIterable{Windows.Devices.Enumeration.DeviceWatcherEventKind}).

Represents a trigger that enables notification of changes to the email store.

Represents a trigger that launches a background task when an incoming change notification is received for a Bluetooth LE GATT characteristic.

Constructs a Generic Attributes (GATT) service that can be persisted in the background.

Represents a location event that triggers a background task. This is used for Geofencing.

Represents a maintenance trigger.

Represents a trigger that launches a background task for performing media processing.

Represents a trigger that activates when the network sends SIM tool commands. Apps receiving this notification then process the SIM tool commands.

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators. For more information, see Mobile Broadband: .

Represents a trigger that indicates when the SIM PIN lock state has changed.

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators. For more information, see Mobile Broadband: .

Represents a trigger that indicates when mobile broadband radio state has changed. For example, this trigger activates when a mobile device transitions to or from airplane mode.

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators. For more information, see Mobile Broadband: .

Represents a trigger that indicates when mobile broadband registration state has changed. For example, this trigger activates when a mobile device transitions to or from Roaming.

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators. For more information, see Mobile Broadband: .

Represents a mobile network operator hotspot authentication trigger.

Note

An app can only instantiate this object and register for the hotspot authentication event after a WLAN profile has been provisioned that references this app to handle hotspot authentication. For more info, see Windows 8 Integration for Wireless Hotspot Operators.

Represents a mobile network operator notification trigger.

Represents a phone event that triggers a background task.

Represents an object that invokes a background work item on the app in response to the receipt of a RawNotification.

Represents a trigger that launches a background task when a new Rich Communication Services (RCS) message is available.

Represents a trigger that launches a background task when an RFCOMM inbound or outbound connections are established.

Represents a trigger that launches a background task on behalf of a companion device.

Represents a trigger that responds when a threshold limit for a sensor is crossed.

Represents an event triggered by a smart card.

Represents a trigger that is raised when an SMS message has arrived.

Represents a trigger that launches a background task for handling socket activity.

Creates a trigger that will fire when a file is changed in a specified library.

Represents a system condition that must be in effect for a background task to run.

Represents a system event that triggers a background task to run.

Represents a time event that triggers a background task to run.

Represents an event that causes a background task to run when the user performs an action on an interactive toast notification.

Represents an event that causes a background task to run when the history of toast notifications for the app is cleared, when one or more toast notifications are added to or removed from the notification history for the app, or when one or more toast notifications for the app expire and are removed from the notification history.

Represents a trigger that fires when a UserNotification is added or removed.

Prerelease. Provides grouping semantics so that background task registration can be maintained separately.

Prerelease. This class contains the trigger created by CreateAsync(System.String,System.Guid).

Interfaces

Used to enforce the system condition object type.

Provides a method to perform the work of a background task.

Provides access to a background task instance.

Provides access to a background task instance. Inherits from the IBackgroundTaskInstance interface and adds the GetThrottleCount(Windows.ApplicationModel.Background.BackgroundTaskThrottleCounter) method.

Provides access to a background task instance including information about the user.

Provides access to a registered background task.

Provides access to a registered background task. Inherits from the IBackgroundTaskRegistration interface and adds the Trigger property.

Represents the base interface for trigger events.

Prerelease. Represents a background task that has been registered as part of a group of related background tasks.

Enums

Indicates whether the user has given permission for the app to set alarms.

The result of the request to trigger a background task. The RequestAsync() method returns a value of this enumeration type.

This enumeration specifies an app's ability to perform background activity.

Apps must successfully call RequestAccessAsync(System.String) before registering background tasks.

Specifies the reasons for cancelling a background task.

Indicates the type of throttle count to check for in a GetThrottleCount(Windows.ApplicationModel.Background.BackgroundTaskThrottleCounter) request.

Indicates the current cost of doing background work. Used as a hint to background tasks about how much work they can do.

Indicates whether the device background task operation was allowed or denied, and if it was denied specifies the reason.

Indicates a type of location event for a location background task trigger.

Specifies the result of a call to RequestAsync(Windows.Foundation.Collections.ValueSet).

Specifies a system condition that must be in effect for a background task to run. If a background task with a system condition is triggered, the task will not run until the condition is met.

Specifies the system events that can be used to trigger a background task.

Delegates

Represents a method that handles the cancellation of a background task.

Represents a method that handles completion events for a background task.

Represents a method that handles progress update events for a background task.