Request user to enable Geolocation


#1

I can see many apps that show an alert to tell users to enable the Geolocation with a button that opens the Geolocation menu of the phone (I’m talking about Android)

How to to that with Ionic or cordova


#2

you need to open the specific intent for location services on android.

this is the native code:

public void openWifiSettings() {
    Intent intent = new Intent(Intent.ACTION_LOCATION_SOURCE_SETTINGS);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}

here is a plugin that should help: