Capacitor: How to Request GPS permission

Created on 15 Jul 2019  路  1Comment  路  Source: ionic-team/capacitor

Hello,
I want to know if there is any way to request GPS permission using capacitor without having to install cordova plugins ?
image
This is the kind of dialogue I want to trigger to enable GPS

Most helpful comment

You can use Geolocation plugin itself to request it's permissions like this: Geolocation.requestPermissions();

Anyway, it's always recommended to let the plugins work themselves, when you try to use getCurrentPosition or watchPosition, the plugin will automatically request the permission if not granted.

>All comments

You can use Geolocation plugin itself to request it's permissions like this: Geolocation.requestPermissions();

Anyway, it's always recommended to let the plugins work themselves, when you try to use getCurrentPosition or watchPosition, the plugin will automatically request the permission if not granted.

Was this page helpful?
0 / 5 - 0 ratings