Finally got it kinda working, Geolocation is not going to work in browser anymore

This commit is contained in:
Joe Bowser 2015-07-14 14:58:55 -07:00
parent 8981ddb681
commit 9a33943783
2 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@ public class CordovaPlugin {
public CordovaInterface cordova; public CordovaInterface cordova;
protected CordovaPreferences preferences; protected CordovaPreferences preferences;
private String serviceName; private String serviceName;
private String [] permissions; protected String [] permissions;
/** /**
* Call this after constructing to initialize the plugin. * Call this after constructing to initialize the plugin.
@ -387,6 +387,8 @@ public class CordovaPlugin {
return false; return false;
} }
} }
return true;
} }
/** /**

View File

@ -183,7 +183,7 @@ public class SystemWebChromeClient extends WebChromeClient {
super.onGeolocationPermissionsShowPrompt(origin, callback); super.onGeolocationPermissionsShowPrompt(origin, callback);
callback.invoke(origin, true, false); callback.invoke(origin, true, false);
//Get the plugin, it should be loaded //Get the plugin, it should be loaded
CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("org.apache.cordova.geolocation.PermissionHandler"); CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
if(geolocation != null && !geolocation.hasPermisssion()) if(geolocation != null && !geolocation.hasPermisssion())
{ {
parentEngine.pluginManager.requestPermission(geolocation); parentEngine.pluginManager.requestPermission(geolocation);