Permission Manager – Request, Test, Manage Permissions
In-Editor Testing & Permissions Management
After the introduction of runtime permissions in Android 6 if you want to access some functionality – you need to first request a permission for it at runtime and Unity does not provide this out of the box. But even if you have the native java code to request the permission – it still takes time to iterate and test, especially on bigger projects, as you need to build to different devices with a bunch of android versions or test in a bunch of emulators, first waiting for it to build. And then anyway no way to quickly get to the desired state you want to test.
When you have a big project with a lot of native plugins it may be hard to track and remove some permission from all the places it is mentioned, especially when some permissions may hide inside .jar and .aar files so you can’t even do a full-text search.
Having these frustrations on our own projects I thought why isn’t there a way to do this from the Unity Editor and so I made Android Permission Manager. This plugin is designed to simplify requesting and managing permissions in the first place, but also adds the ability to test permissions behavior for any Android version right in the editor.
Painless Permission Requesting
Request permissions for any android version with a single line of code, using a list of permission constants or any custom string
Permission List Editing
“Where should you add the permission?” “What should be in the default manifest?” – Just let the plugin create and manage this for you. Simply add the permission you want within the Editor with the help of autocomplete and you are ready to go.
Permission list editing also allows you to remove permissions from all manifests to avoid hunting for them, even from manifests inside .jar and .aar files if needed.
Fix Unity Default Behavior With a Single Click
By default, Unity requests all dangerous permissions at the first start of the app without any explanation to the user and no way for you to easily change this. This will also not go well with the Android review team.
This plugin allows you to disable this behavior with a single click and request permissions right before you need them.
ShouldShowRequestPermissionRationale allows you to easily follow google guidelines and show a rationale dialog for all permission requests after the first request was denied. And also avoid showing it when the request was denied with “Never ask again” checked. You can test this behavior right from the editor.
Automatic Manifest Creation
Unity is great for having an automatic manifest creation while you don’t need anything custom, but if you want to request permissions yourself – you can’t rely on it anymore.
This Plugin allows you to maintain this convenience by creating and managing the AndroidManifest for you.
Test Permissions Right From The Editor
Without a quick way to test permission behavior right in the editor for any android version, it may become very tiring to test on all Android versions, and this may lead to bugs.
But with this plugin – the code you write to request permissions on Android will also allow you to test its behavior in the editor at the same time, you don’t need to change it in any way. Just tick the checkbox to enable in-editor testing.
- max-sdk and uses-permission-sdk support for testing