Skip to content

Commit

Permalink
Merge pull request #741 from sergeich/patch-1
Browse files Browse the repository at this point in the history
Use ActivityCompat to check if permission is granted
  • Loading branch information
morenoh149 authored Aug 13, 2024
2 parents 4f7ffb7 + a219c16 commit be9d46d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ private String getValueFromKey(ReadableMap item, String key) {
*/
private String isPermissionGranted() {
// return -1 for denied and 1
int res = getReactApplicationContext().checkSelfPermission(PERMISSION_READ_CONTACTS);
int res = ActivityCompat.checkSelfPermission(getReactApplicationContext(), PERMISSION_READ_CONTACTS);
return (res == PackageManager.PERMISSION_GRANTED) ? PERMISSION_AUTHORIZED : PERMISSION_DENIED;
}

Expand Down

0 comments on commit be9d46d

Please sign in to comment.