Control user GPS without leaving the application

I am currently creating an application that makes use of the user’s geolocation, however, when the user does not have gps active I cannot access their location.

How can I ask the user to activate the gps on his device and activate it without leaving the app?

I found a plugin that can serve but it is Cordova, I wonder if there is an option with capacitor. The plugin is:

npm install cordova-plugin-request-location-accuracy
npm install @ionic-native/location-accuracy