I work on a cordova jquery mobile project.
I would like to know if it is possible to have a callback after triggered the switchToLocationSettings() function.
i would like to know if the user have enabled GPS on his device.
i use it like this:
cordova.plugins.diagnostic.switchToLocationSettings();
but i would like something like this:
cordova.plugins.diagnostic.switchToLocationSettings(Success,Error);
is it possible?
According to Java Code, there is no callback method for this function. Check Below -
/**
* Requests that the user enable the location in device settings.
*/
public void switchToLocationSettings() {
Log.d(LOG_TAG, "Switch to Location Settings");
Intent settingsIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
ctx.startActivity(settingsIntent);
}
That's why you are not able to pass any extra callback function in this method. You have to write your own code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With