Dela via


DeviceServicingTrigger.RequestAsync Method

Definition

Overloads

RequestAsync(String, TimeSpan)

Triggers the background task (settings or firmware update) and returns a DeviceTriggerResult indicating success or failure of the trigger request. Takes the DeviceInformation.ID string and an optional estimated time the background task will run. If your app cannot determine an appropriate time estimate, provide zero as the estimated time.

RequestAsync(String, TimeSpan, String)

Triggers the background task (settings or firmware update) and returns a DeviceTriggerResult indicating success or failure of the trigger request. Takes the DeviceInformation.ID string, an optional estimated time the background task will run, and an optional app-specific string passed to the background task identifying which device operation to perform. If your app cannot determine an appropriate time estimate, provide zero as the estimated time.

RequestAsync(String, TimeSpan)

Triggers the background task (settings or firmware update) and returns a DeviceTriggerResult indicating success or failure of the trigger request. Takes the DeviceInformation.ID string and an optional estimated time the background task will run. If your app cannot determine an appropriate time estimate, provide zero as the estimated time.

public:
 virtual IAsyncOperation<DeviceTriggerResult> ^ RequestAsync(Platform::String ^ deviceId, TimeSpan expectedDuration) = RequestAsync;
/// [Windows.Foundation.Metadata.DefaultOverload]
/// [Windows.Foundation.Metadata.Overload("RequestAsyncSimple")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DeviceTriggerResult> RequestAsync(winrt::hstring const& deviceId, TimeSpan const& expectedDuration);
[Windows.Foundation.Metadata.DefaultOverload]
[Windows.Foundation.Metadata.Overload("RequestAsyncSimple")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DeviceTriggerResult> RequestAsync(string deviceId, System.TimeSpan expectedDuration);
function requestAsync(deviceId, expectedDuration)
Public Function RequestAsync (deviceId As String, expectedDuration As TimeSpan) As IAsyncOperation(Of DeviceTriggerResult)

Parameters

deviceId
String

Platform::String

winrt::hstring

The DeviceInformation.ID of the device the background task will access. The device path must match the device that will perform the background operation and is used by Windows to ensure that policy requirements are met.

expectedDuration
TimeSpan TimeSpan

Optional value. The expected duration of the background settings update or background firmware update. If provided, it will be displayed to the user in the system consent dialog when the task is triggered by your app. Set this value to zero if an appropriate time estimate cannot be determined.

Returns

This method returns a DeviceTriggerResult when it completes asynchronously.

Attributes

See also

Applies to

RequestAsync(String, TimeSpan, String)

Triggers the background task (settings or firmware update) and returns a DeviceTriggerResult indicating success or failure of the trigger request. Takes the DeviceInformation.ID string, an optional estimated time the background task will run, and an optional app-specific string passed to the background task identifying which device operation to perform. If your app cannot determine an appropriate time estimate, provide zero as the estimated time.

public:
 virtual IAsyncOperation<DeviceTriggerResult> ^ RequestAsync(Platform::String ^ deviceId, TimeSpan expectedDuration, Platform::String ^ arguments) = RequestAsync;
/// [Windows.Foundation.Metadata.DefaultOverload]
/// [Windows.Foundation.Metadata.Overload("RequestAsyncWithArguments")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DeviceTriggerResult> RequestAsync(winrt::hstring const& deviceId, TimeSpan const& expectedDuration, winrt::hstring const& arguments);
[Windows.Foundation.Metadata.DefaultOverload]
[Windows.Foundation.Metadata.Overload("RequestAsyncWithArguments")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DeviceTriggerResult> RequestAsync(string deviceId, System.TimeSpan expectedDuration, string arguments);
function requestAsync(deviceId, expectedDuration, arguments)
Public Function RequestAsync (deviceId As String, expectedDuration As TimeSpan, arguments As String) As IAsyncOperation(Of DeviceTriggerResult)

Parameters

deviceId
String

Platform::String

winrt::hstring

The DeviceInformation.ID of the device the background task will access. The device path must match the device that will perform the background operation and is used by Windows to ensure that policy requirements are met.

expectedDuration
TimeSpan TimeSpan

Optional value. The expected duration of the background settings update or background firmware update. If provided, it will be displayed to the user in the system consent dialog when the task is triggered by your app. Set this value to zero if an appropriate time estimate cannot be determined.

arguments
String

Platform::String

winrt::hstring

Optional value. An app-specific string passed to the background task identifying which device operation to perform.

Returns

This method returns a DeviceTriggerResult when it completes asynchronously.

Attributes

See also

Applies to