BackgroundExecutionManager BackgroundExecutionManager BackgroundExecutionManager BackgroundExecutionManager Class

Definition

Manage permission to run background tasks.

public : static class BackgroundExecutionManager
public static class BackgroundExecutionManager
Public Static Class BackgroundExecutionManager
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

GetAccessStatus() GetAccessStatus() GetAccessStatus() GetAccessStatus()

Gets the app's background task execution capability.

public : static BackgroundAccessStatus GetAccessStatus()
public static BackgroundAccessStatus GetAccessStatus()
Public Static Function GetAccessStatus() As BackgroundAccessStatus
var backgroundAccessStatus = Windows.ApplicationModel.Background.BackgroundExecutionManager.getAccessStatus();
Returns

An enumeration value that specifies the app's background capabilities.

See Also

GetAccessStatus(String) GetAccessStatus(String) GetAccessStatus(String) GetAccessStatus(String)

Gets the specified app's background task execution capability.

public : static BackgroundAccessStatus GetAccessStatus(Platform::String applicationId)
public static BackgroundAccessStatus GetAccessStatus(String applicationId)
Public Static Function GetAccessStatus(applicationId As String) As BackgroundAccessStatus
var backgroundAccessStatus = Windows.ApplicationModel.Background.BackgroundExecutionManager.getAccessStatus(applicationId);
Parameters
applicationId
Platform::String String String String

The Package Relative Application ID (PRAID) of the app whose capabilities are being retrieved. The specified app must be in the same package as the calling app.

Returns

An enumeration value that specifies the app's background capabilities.

See Also

RemoveAccess() RemoveAccess() RemoveAccess() RemoveAccess()

Removes the calling app from the list of apps that may run background tasks.

public : static void RemoveAccess()
public static void RemoveAccess()
Public Static Function RemoveAccess() As void
Windows.ApplicationModel.Background.BackgroundExecutionManager.removeAccess();
See Also

RemoveAccess(String) RemoveAccess(String) RemoveAccess(String) RemoveAccess(String)

Removes a specific app from the list of apps that may run background tasks.

public : static void RemoveAccess(Platform::String applicationId)
public static void RemoveAccess(String applicationId)
Public Static Function RemoveAccess(applicationId As String) As void
Windows.ApplicationModel.Background.BackgroundExecutionManager.removeAccess(applicationId);
Parameters
applicationId
Platform::String String String String

The Package Relative Application ID (PRAID) of the app to be removed from the list of apps that may run background tasks. The specified app must be in the same package as the calling app.

See Also

RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync()

Requests that the app be permitted to run background tasks.

public : static IAsyncOperation<BackgroundAccessStatus> RequestAccessAsync()
public static IAsyncOperation<BackgroundAccessStatus> RequestAccessAsync()
Public Static Function RequestAccessAsync() As IAsyncOperation( Of BackgroundAccessStatus )
var iAsyncOperation = Windows.ApplicationModel.Background.BackgroundExecutionManager.requestAccessAsync();
Returns

Remarks

VersionBehavior
Windows 8/Windows 8.1Prompts the user with a dialog box that requests that an app be added to the lock screen. Must be called before registering any background tasks.
Windows Phone 8.1Does not prompt the user, but must be called before registering any background tasks.
Windows 10Does not prompt the user, but must be called before registering any background tasks. You do not need to add the app to the lock screen in order to use background tasks in Windows 10, but you still need to call RequestAccessAsync to request background access.

Tip

Starting with Windows 10, it is no longer necessary to call this method from the UI thread.

See Also

RequestAccessAsync(String) RequestAccessAsync(String) RequestAccessAsync(String) RequestAccessAsync(String)

Requests that the app be permitted to run background tasks.

public : static IAsyncOperation<BackgroundAccessStatus> RequestAccessAsync(Platform::String applicationId)
public static IAsyncOperation<BackgroundAccessStatus> RequestAccessAsync(String applicationId)
Public Static Function RequestAccessAsync(applicationId As String) As IAsyncOperation( Of BackgroundAccessStatus )
var iAsyncOperation = Windows.ApplicationModel.Background.BackgroundExecutionManager.requestAccessAsync(applicationId);
Parameters
applicationId
Platform::String String String String

The Package Relative Application ID (PRAID) of the app to be permitted to run background tasks. The specified app must be in the same package as the calling app.

Returns

Remarks

VersionBehavior
Windows 8/Windows 8.1Prompts the user with a dialog box that requests that an app be added to the lock screen. Must be called before registering any background tasks.
Windows Phone 8.1Does not prompt the user, but must be called before registering any background tasks.
Windows 10Does not prompt the user, but must be called before registering any background tasks. You do not need to add the app to the lock screen in order to use background tasks in Windows 10, but you still need to call RequestAccessAsync to request background access.

Tip

Starting with Windows 10, it is no longer necessary to call this method from the UI thread.

See Also

See Also