Handles the status of the app's capability permissions. More...
Import Statement: | import ArcGIS.AppFramework.Platform 1.0 |
Methods
- PermissionResult checkPermission(permissiontype type)
- ServiceStatus serviceStatus(permissionservice service)
Detailed Description
The Permission component handles the returning of permissions provided to the app by the system. This component is a singleton, and does not need to be instantiated.
Be aware that the Permission component can't change these permissions. Changing permissions can only be done through the use of PermissionDialog.
Enumerations
PermissionType enumeration
Enum describing the permission being checked. Informs the parameter required for the checkPermission method.
Name | Value |
---|---|
Permission.PermissionTypeBluetooth | 0 |
Permission.PermissionTypeCamera | 1 |
Permission.PermissionTypeMicrophone | 2 |
Permission.PermissionTypeLocationWhenInUse | 3 |
Permission.PermissionTypeLocationAlwaysInUse | 4 |
Permission.PermissionTypeStorage | 5 |
Permission.PermissionTypeMediaLocation | 6 |
PermissionResult enumeration
Enum describing the potential results of the checkPermission method.
The PermissionResultRestricted value means that the capability has not been enabled in the app's Settings tool.
Name | Value |
---|---|
Permission.PermissionResultGranted | 0 |
Permission.PermissionResultDenied | 1 |
Permission.PermissionResultRestricted | 2 |
Permission.PermissionResultUnknown | 3 |
PermissionService enumeration
Name | Value |
---|---|
Permission.BluetoothService | 0 |
Permission.LocationService | 1 |
ServiceStatus enumeration
Name | Value |
---|---|
Permission.ServiceStatusUnknown | 0 |
Permission.ServiceStatusReset | 1 |
Permission.ServiceStatusUnsupported | 2 |
Permission.ServiceStatusUnauthorized | 3 |
Permission.ServiceStatusPoweredOff | 4 |
Permission.ServiceStatusPoweredOn | 5 |
Method Documentation
Check the status of a given capability permission. This will return the result, as informed by the PermissionResult enum.
This method will return PermissionResultUnknown for all permission types on Windows and macOS, and for the background location permission type on Android.
The type parameter
The capability permission to check the status of. Informed by the PermissionType enum.
Check real-time state of the device using a service such as location or Bluetooth, and return the result.
Label { id: locationServiceText text: "Location service status:" + Permission.serviceStatus(Permission.LocationService) }
The service parameter
The state of the service. Informed by the PermissionService enum.
On Windows, macOS and Linux, this method will always return ServiceStatusUnknown for all service types.