Android Permissions
The Android Permissions plugin is designed to support Android's new permissions checking mechanism, introduced in Android 8.0 (API level 26). Permissions are requested at time of use rather than at runtime. You can find all permissions here.
#
InstallationIf you have not already setup Ionic Enterprise in your app, follow the one-time setup steps.
Next, install the plugin:
- Capacitor
- Cordova
#
Index#
Classes#
Classes#
AndroidPermissionsusage:
#
PERMISSION● PERMISSION: any
#
checkPermission▸ checkPermission(permission: string
): Promise
<any
>
Check permission
Parameters:
Name | Type | Description |
---|---|---|
permission | string | The name of the permission |
Returns: Promise
<any
>
Returns a promise
#
hasPermission▸ hasPermission(permission: string
): Promise
<any
>
This function still works now, will not support in the future.
Parameters:
Name | Type | Description |
---|---|---|
permission | string | The name of the permission |
Returns: Promise
<any
>
Returns a promise
#
requestPermission▸ requestPermission(permission: string
): Promise
<any
>
Request permission
Parameters:
Name | Type | Description |
---|---|---|
permission | string | The name of the permission to request |
Returns: Promise
<any
>
#
requestPermissions▸ requestPermissions(permissions: string
[]): Promise
<any
>
Request permissions
Parameters:
Name | Type | Description |
---|---|---|
permissions | string [] | An array with permissions |
Returns: Promise
<any
>
Returns a promise