CordovaPlugin.hasPermisssion method name typo
See original GitHub issueClearly, the name hasPermisssion
is misspelled, and should be hasPermission
instead…
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Deprecate old plugin target-dir structure support #580 - GitHub
I already warned cordova-plugin-purchase in j3k0/cordova-plugin-purchase#766, we should probably ... hasPermisssion method name typo #593.
Read more >Issues with android permissions in Cordova - Stack Overflow
On Android >=6.0, Android app should request permission runtime. So in Cordova, you can use the permission plugin like following
Read more >sc-cordova-plugin-email-composer - npm
Provides access to the standard interface that manages the editing and sending an email message . Latest version: 1.0.0, last published: 5 ...
Read more >cordova-plugin-health/Lobby - Gitter
Sorry I made a typo above, the config xml should be. <plugin name="cordova-plugin-health" source="npm" spec="2.0.0" >. <preference name="AndroidXEnabled" ...
Read more >cordova-plugin-email-composer | Yarn - Package Manager
document.addEventListener('deviceready', function () { // cordova.plugins.email is now available }, false);.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
From a quick code search I find the misspelled
hasPermisssion
method is called in only one piece of code, in the following function: https://github.com/apache/cordova-android/blob/8a4ae311ce165e31f0511ae43274aa52d3773fd2/framework/src/org/apache/cordova/engine/SystemWebChromeClient.java#L170-L180I think this would only be an issue for any plugins with feature name=“Geolocation”, and not many plugins other than
cordova-plugin-geolocation
would use this feature name.I think of the following quick solution:
CordovaPlugin.java
CordovaPlugin.java
tries both “hasPermission” and misspelledhasPermisssion
cordova-plugin-geolocation
to override the new method, in a major version increase, with dependency on new cordova-android engine versionhasPermisssion
method as deprecated, for complete removal at some point in the future (with plenty of warning of course)Ideas for refinement:
onGeolocationPermissions
oronGeolocationPermissionsShowPrompt
hook function, which the plugin would override to call its ownrequestPermissions
function if necessaryonPause
,onReceivedHttpAuthRequest
, etc.How hard would it be to make it so that older plugins can be built against a specific version of the plugin API? That would help, even if whoever is using the plugins has to explicitly configure it (since obviously the plugin itself will not).