How to enable gps services programatically in capacitor?

I am using capacitor 2.0.1. And when I am using geolocation API from the capacitor. if GPS is off, then I get the below result.


{message: "location unavailable"}
message: "location unavailable"

But how to enable GPS, if it’s off? Please advice.

Installed Dependencies:

  @capacitor/cli: 2.0.1

  @capacitor/core: 2.0.1

  @capacitor/android: 2.0.1

  @capacitor/electron: 2.0.1

  @capacitor/ios: 2.0.1