-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onRequestPermissionResult deprecation issue #1388
Comments
They are both called by the PermissionsHelper:
We can't remove |
Where does |
Also, does it make sense for the |
This isn't really correct though, this method is private and never called by anything that I can see. There's essentially no way to have onRequestPermissionResults be called. |
@gwynjudd I think the If I remember correctly, this helper class originated from Apache's I believe the class was copied to this repo to make it available for other plugins and was a part of Cordova-Android 5 backward compatibility support. #594 Removing Even though Apache has added the deprecated flag and updated Apache core plugins to not use the method, many unmaintained third-party plugins works with the current version of Cordova-Android and could be calling the deprecated method. If we remove the method, then all those plugins will stop working. There might have been some agreement that this step has to be taken either way, but when? |
Hello,
It is this method in PermissionsHelper which is private
https://github.com/apache/cordova-android/blob/c9e7c5998635ad86412c5e8ef90df357a1676dcf/framework/src/org/apache/cordova/PermissionHelper.java#L76
As far as I can tell, it is the only method which ever calls CordovaPlugin#onRequestPermissionResult
From: Thibault ***@***.***>
Sent: Thursday, 3 August 2023 8:49 pm
To: apache/cordova-android ***@***.***>
Cc: Gwyn Judd ***@***.***>; Mention ***@***.***>
Subject: Re: [apache/cordova-android] onRequestPermissionResult deprecation issue (Issue #1388)
Hi @gwynjudd<https://github.com/gwynjudd>,
Small question, how this method is private?
https://github.com/apache/cordova-android/blob/c9e7c5998635ad86412c5e8ef90df357a1676dcf/framework/src/org/apache/cordova/CordovaPlugin.java#L413-L426
By my understanding, both method works at the end?
Kr.
-
Reply to this email directly, view it on GitHub<#1388 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AACMWTFT62NMSJAUXU2LNSDXTNQYZANCNFSM5LKYYHOQ>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
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
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
I've just spent a day adding If you override To actually get called back, you have to override the deprecated method The documentation correctly tells you to use the old deprecated method name. I was surprised to find that Android Studio struck through the method name indicating that it was deprecated. I changed it to the new name, then wasted a lot of time wondering why it didn't work until I realised that the callback wasn't even called. In my project, nothing calls Suggested fixes:
I also suggest that |
As an alternative, we could make
It may be worth renaming the method in |
onRequestPermissionResult
is marked as deprecated in favor ofonRequestPermissionsResult
:cordova-android/framework/src/org/apache/cordova/CordovaPlugin.java
Lines 418 to 424 in a1ed1c0
However,
CordovaInterfaceImpl
calls the deprecated method instead of the new one:cordova-android/framework/src/org/apache/cordova/CordovaInterfaceImpl.java
Lines 218 to 224 in a1ed1c0
Maybe should
CordovaPlugin
's default implementation ofonRequestPermissionResult
call the newonRequestPermissionsResult
method untilonRequestPermissionResult
is removed?The text was updated successfully, but these errors were encountered: