BackgroundExecutionManager.RequestAccessAsync | requestAccessAsync Methods
Liste de surcharge
| Méthode | Description |
|---|---|
| RequestAccessAsync() | Presents the user with a dialog box that requests that the calling app be added to the lock screen. |
| RequestAccessAsync(String) | Presents the user with a dialog box that requests that the specified app be added to the lock screen. |
Exemples
Cet exemple illustre cette méthode lorsqu'elle est utilisée pour ajouter une application à l'écran de verrouillage.
var Background = Windows.ApplicationModel.Background; var promise = Background.BackgroundExecutionManager.requestAccessAsync().then( function(result) { switch (result) { case Background.BackgroundAccessStatus.denied: // Background activity and updates for this app are disabled by the user. break; case Background.BackgroundAccessStatus.allowedWithAlwaysOnRealTimeConnectivity: // Added to list of background apps. // Set up background tasks; can use the network connectivity broker. break; case Background.BackgroundAccessStatus.allowedMayUseActiveRealTimeConnectivity: // Added to list of background apps. // Set up background tasks; cannot use the network connectivity broker. break; case Background.BackgroundAccessStatus.unspecified: // The user didn't explicitly disable or enable access and updates. break; } });
Configuration requise
|
Client minimal pris en charge | Windows 8 |
|---|---|
|
Serveur minimal pris en charge | Windows Server 2012 |
|
Espace de noms |
|
|
Métadonnées |
|
Voir aussi
