Search docs/
Getting StartedPlugins

Android Permissions

This plugin is designed to support Android new permissions checking mechanism.

You can find all permissions here: https://developer.android.com/reference/android/Manifest.permission.html

https://github.com/NeoLSN/cordova-plugin-android-permissions

Premier Version Available

Featuring regular release cycles, security and bug fixes, and guaranteed SLAs.

Available here

インストール

ionic cordova plugin add cordova-plugin-android-permissionsnpm install @ionic-native/android-permissionsnpm install cordova-plugin-android-permissionsnpm install @ionic-native/android-permissionsionic cap sync
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、エンタープライズプラグインに興味があれば 連絡ください

サポートしているプラットフォーム

  • Android

利用方法

Using React?

See here.

import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';


constructor(private androidPermissions: AndroidPermissions) { }

...

this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(
  result => console.log('Has permission?',result.hasPermission),
  err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
);

this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);

Android 26 and above: due to Android 26's changes to permissions handling (permissions are requested at time of use rather than at runtime,) if your app does not include any functions (eg. other Ionic Native plugins) that utilize a particular permission, then requestPermission() and requestPermissions() will resolve immediately with no prompt shown to the user. Thus, you must include a function utilizing the feature you would like to use before requesting permission for it.