GetAccessStatus | getAccessStatus methods

BackgroundExecutionManager.GetAccessStatus | getAccessStatus methods

Gets the app's background task execution capability.

Overload list

MethodDescription
GetAccessStatus() Gets the app's background task execution capability.
GetAccessStatus(String) Gets the specified app's background task execution capability.

Examples

This example shows how to use this method to query for an app's background access.


var Background = Windows.ApplicationModel.Background;

var result = Background.BackgroundApplications.getAccessStatus();
switch (result) {
    case Background.BackgroundAccessStatus.denied:
        // Disabled by the user.
        // App cannot execute background tasks
        break;
    
    case Background.BackgroundAccessStatus.allowedWithAlwaysOnRealTimeConnectivity:
        // Added to list of background applications.
        // Can set up background tasks and use the network connectivity broker.
        break;
    
    case Background.BackgroundAccessStatus.allowedMayUseActiveRealTimeConnectivity:
        // Added to list of background applications.
        // Can set up background tasks but cannot use the network connectivity broker.
        break;
       
    case Background.BackgroundAccessStatus.unspecified:
        // The user didn't explicitly disable or enable.
        break;
    }

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.ApplicationModel.Background
Windows::ApplicationModel::Background [C++]

Metadata

Windows.winmd

See also

BackgroundExecutionManager

 

 

Show:
© 2016 Microsoft