Java Code Examples for org.apache.cordova.CordovaPlugin#requestPermissions()

The following examples show how to use org.apache.cordova.CordovaPlugin#requestPermissions() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SystemWebChromeClient.java    From BigDataPlatform with GNU General Public License v3.0 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 2
Source File: SystemWebChromeClient.java    From xmall with MIT License 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 3
Source File: SystemWebChromeClient.java    From ultimate-cordova-webview-app with MIT License 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 4
Source File: X5WebChromeClient.java    From x5webview-cordova-plugin with Apache License 2.0 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissionsCallback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 5
Source File: SystemWebChromeClient.java    From keemob with MIT License 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 6
Source File: SystemWebChromeClient.java    From keemob with MIT License 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 7
Source File: X5WebChromeClient.java    From cordova-plugin-x5-tbs with Apache License 2.0 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissionsCallback callback) {
  super.onGeolocationPermissionsShowPrompt(origin, callback);
  callback.invoke(origin, true, false);
  //Get the plugin, it should be loaded
  CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
  if (geolocation != null && !geolocation.hasPermisssion()) {
    geolocation.requestPermissions(0);
  }

}
 
Example 8
Source File: SystemWebChromeClient.java    From app-icon with MIT License 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 9
Source File: X5WebChromeClient.java    From cordova-plugin-x5engine-webview with Apache License 2.0 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissionsCallback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 10
Source File: SystemWebChromeClient.java    From cordova-plugin-app-update-demo with MIT License 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 11
Source File: SystemWebChromeClient.java    From pychat with MIT License 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 12
Source File: SystemWebChromeClient.java    From lona with GNU General Public License v3.0 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 13
Source File: SystemWebChromeClient.java    From countly-sdk-cordova with MIT License 6 votes vote down vote up
@Override
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}
 
Example 14
Source File: X5WebChromeClient.java    From cordova-plugin-x5-webview with Apache License 2.0 5 votes vote down vote up
/**
 * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
 *
 * This also checks for the Geolocation Plugin and requests permission from the application  to use Geolocation.
 *
 * @param origin
 * @param callback
 */
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissionsCallback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, false);
    //Get the plugin, it should be loaded
    CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
    if(geolocation != null && !geolocation.hasPermisssion())
    {
        geolocation.requestPermissions(0);
    }

}