Skip to content

Commit

Permalink
feat(android): method to check permission for an alias (#4062)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlpoole committed Jan 13, 2021
1 parent 70fdf0b commit c88c4b4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions android/capacitor/src/main/java/com/getcapacitor/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,16 @@ public void pluginRequestPermission(String permission, int requestCode) {
ActivityCompat.requestPermissions(getActivity(), new String[] { permission }, requestCode);
}

/**
* Get the permission state for the provided permission alias.
*
* @param alias the permission alias to get
* @return the state of the provided permission alias or null
*/
public PermissionState getPermissionState(String alias) {
return getPermissionStates().get(alias);
}

/**
* Helper to check all permissions defined on a plugin and see the state of each.
*
Expand Down

0 comments on commit c88c4b4

Please sign in to comment.