You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/11/29 22:32:50 UTC

[GitHub] brodybits commented on issue #593: CordovaPlugin.hasPermisssion method name typo

brodybits commented on issue #593: CordovaPlugin.hasPermisssion method name typo
URL: https://github.com/apache/cordova-android/issues/593#issuecomment-443018869
 
 
   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-L180
   
   I 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:
   * we introduce the correct method name ("hasPermission") in `CordovaPlugin.java`
   * `CordovaPlugin.java` tries both "hasPermission" and misspelled `hasPermisssion`
   * Update `cordova-plugin-geolocation` to override the new method, in a major version increase, with dependency on new cordova-android engine version
   * Mark the incorrect `hasPermisssion` method as deprecated, for complete removal at some point in the future (with plenty of warning of course)
   
   Ideas for refinement:
   * new callback method should be void `onGeolocationPermissions` or `onGeolocationPermissionsShowPrompt` hook function, which the plugin would override to call its own `requestPermissions` function if necessary
   * make it possible for multiple plugins to override the new callback, and Cordova would query all plugins, like it does on `onPause`, `onReceivedHttpAuthRequest`, etc.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org