How to develop "to continue turn on device location" ?

Hi All,

I'd like to develop a client action that when user clicks "Ok", turns ON automatically the GPS location as done by google maps. Here's below the pop up that i shall mimic. How to make it ? 

I think that if you trigger the "CheckLocationPlugin" the device should prompt the user to turn on the GPS. Or at least ask if he allows the app to do so. 



Bruno Gonçalves wrote:

I think that if you trigger the "CheckLocationPlugin" the device should prompt the user to turn on the GPS. Or at least ask if he allows the app to do so. 




It's the CheckGPS that returns if location is enabled or not. CheckLocationPlugin has a different purpose. Anyway, my question is how to let the user enable it by himself from within the application like google maps do

Hi, Kata

From my knowledge, upon any call of the plugin, if the user has not given permissions in the past for the app to use the service, there will be a native confirmation popup, like the one you want.

Regards,

Sam

Hi Kata,


  As colleagues have said, when the user performs the action that is using a hardware feature through a Cordova plug-in for the first time, the Operating System will prompt the user for permission.  If the feature is not available, you will receive an error message, which you can manage and display a message to the user.  We cannot enable GPS functionality if the app did not receive user permission the first time it was run.


Best Regards,

Leandro. 

Hi All,


It looks like i failed to explain it properly, hence i added what i'm looking for as GIF image. Hope it helps.


I don't know if this works for you since it has an additional step.


Click the button

Choose "High Accuracy"


GPS is on...


Works on Android


I just tried it, I was easily able to. I am quite new to OutSystems too.


Here is a screenshot. Its quite easy actually.



Please share oml in case you need more help ( Also be sure your oml does not contain confidential logic you wrote ) . Community can help you out for most issues. we in community are quite active here.

Regards,
Nuno Verdasca

Hi,

I'm using the Location Plugin

Maybe this suits your needs?


Thanks,

Nuno Verdasca

Hi Kata,

OutSystems use the Cordova Framework to access hardware functions,  If the user has not allowed your app to use Geolocation or the GPS is not on all together. There is no way of changing that setting from Cordova. It is on the User to allow for the location service to be used. 

Using the Location plugin, for example, you'll receive a Error Message, you can show a friendly message to user verify the GPS and turn it on.