/Unity-AndroidPermission

a wrapper of android runtime permission for Unity

Primary LanguageC#MIT LicenseMIT

UnityAndroidPermission

a wrapper of methods for android runtime permission for Unity

Install

Use AndroidPermission.unitypackage

Before you use this, you must install

  • AndroidSDK(ver25 or more)
  • AndroidBuildTools(ver25.03 or more)

You can know how to setup these tools at https://docs.unity3d.com/Manual/android-sdksetup.html

Usage

AndroidPermissionManager.IsRuntimePermissionDevice()
  • Method for checking if your device need android's runtime permissions

AndroidPermissionManager.RequestPermissions(IEnumerable<AndroidPermission> permissions)

AndroidPermissionManager.CheckSelfPermission(AndroidPermission permission)

AndroidPermissionManager.ShouldShowRequestPermissionRationale(AndroidPermission permission)

AndroidPermission.XXX
//ex)AndroidPermission.GET_ACCOUNTS

Example

//request camera permission
AndroidPermissionManager.RequestPermissions(new AndroidPermission[] { AndroidPermission.CAMERA });

Licence

MIT