EasyPermissions is a wrapper library to simplify basic system permissions logic when targeting Android M or higher. If your app is written in Kotlin consider the easypermissions-ktx library which adds Kotlin extensions to the core EasyPermissions library. To begin using EasyPermissions, have your Activity (or Fragment) override the onRequestPermissionsResult method. If all of the permissions in a given request are granted, all methods annotated with the proper request code will be executed(be sure to have an unique request code). The annotated method needs to be void and without input parameters (instead, you can use onSaveInstanceState in order to keep the state of your suppressed parameters). This is to simplify the common flow of needing to run the requesting method after all of its permissions have been granted. Optionally, for a finer control, you can have your Activity / Fragment implement the PermissionCallbacks interface.
Features
- Simplify basic system permissions logic when targeting Android M or higher
- Implement the EasyPermissions.RationaleCallbacks if you want to interact with the rationale dialog
- For a finer control, you can have your Activity / Fragment implement the PermissionCallbacks interface
- Check if the app already has the required permissions
- Request the system permissions and show the rationale string provided if necessary
- Simplify the common flow of needing to run the requesting method after all of its permissions have been granted