Tweaking the geolocation plugin to contain all the permissions code. Sadly, we have to do this.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/3f0c0636 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/3f0c0636 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/3f0c0636 Branch: refs/heads/master Commit: 3f0c06368a02c0921e44562a60da7d3833f9926c Parents: cc7e3cb Author: Joe Bowser <[email protected]> Authored: Tue Oct 6 13:29:03 2015 -0700 Committer: Joe Bowser <[email protected]> Committed: Wed Oct 28 12:00:27 2015 -0700 ---------------------------------------------------------------------- src/android/Geolocation.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/3f0c0636/src/android/Geolocation.java ---------------------------------------------------------------------- diff --git a/src/android/Geolocation.java b/src/android/Geolocation.java index 3db8a56..79c6d2c 100644 --- a/src/android/Geolocation.java +++ b/src/android/Geolocation.java @@ -89,9 +89,19 @@ public class Geolocation extends CordovaPlugin { return false; } } - return true; } + /* + * We override this so that we can access the permissions variable, which no longer exists in + * the parent class, since we can't initialize it reliably in the constructor! + */ + + public void requestPermissions(int requestCode) + { + cordova.requestPermissions(this, requestCode, permissions); + } + + } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
