Skip to content

Commit

Permalink
Declare onRequestPermissionResult instead of onRequestPermissionsResult
Browse files Browse the repository at this point in the history
As noted in the comment, the former is deprecated in favour of the
latter, but the latter is never called. See also:

- apache/cordova-android#1388
- apache/cordova-android#1393

I hope the comment will help us fix the problem quickly when the Cordova
folks decide to remove the deprecated method. (And hopefully make sure
that the new method is called.)

Addresses: https://trello.com/c/zsmadleg/2549-mind-ease-notifications-probably-broken-on-android
  • Loading branch information
rmoehn committed Oct 24, 2023
1 parent 583c592 commit ea8f88c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/android/Permission.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ private void ensure(String name, CallbackContext callbackContext) {
}
}

// This is deprecated in favour of onRequestPermissionsResult, but as of
// this writing, Cordova never calls onRequestPermissionsResult. So we have
// to use the deprecated method until they fix this.
@SuppressWarnings("deprecation")
@Override
public void onRequestPermissionsResult(
public void onRequestPermissionResult(
int requestCode, String[] permissions, int[] grantResults
) throws JSONException {
Log.i(TAG, "Permission request callback called. requestCode: " + requestCode);
Expand Down

0 comments on commit ea8f88c

Please sign in to comment.