[Location Plugin] CheckLocationPlugin method

[Location Plugin] CheckLocationPlugin method

  
Forge Component
(18)
Published on 26 Sep by OutSystems R&D
18 votes
Published on 26 Sep by OutSystems R&D

Shouldn'd the CheckLocationPlugin method return false when the mobile's gps is disabled? 

I'm always getting TRUE as the output of this method.


Hello, Hugo,

According to the GitHub readme, the way the plugin reports permissions is through different error codes, through a PositionError.PERMISSION_DENIED constant, when calling GetLocation.

Will this do? If you need better control over when to ask for permissions and check them (and are targeting Android only), you can try one of these two plugins. We haven't tested them, but they might just do what you're looking for.

Best regards,

Carlos Simões

Carlos Simões wrote:

Hello, Hugo,

According to the GitHub readme, the way the plugin reports permissions is through different error codes, through a PositionError.PERMISSION_DENIED constant, when calling GetLocation.

Will this do? If you need better control over when to ask for permissions and check them (and are targeting Android only), you can try one of these two plugins. We haven't tested them, but they might just do what you're looking for.

Best regards,

Carlos Simões

Thank you for the reply, my question was about the action CheckLocationPlugin:


Shouldn't this action return the status of the device's GPS? If it's active or not.

If I use the action GetLocation I'll be forced to wait for the time out and only after that I'll be able to process the error code, wich means that my loading time for that page won't be shorter than the time out defined for that action.


Best regars

Hugo Antunes

I see...well, changing the "CheckLocationPlugin" to work like this won't be that straightforward, since it requires specific native code to make that information visible.

Having said that, what I had in mind was that you could call the "GetLocation" action, catch the error and change the UI accordingly.

I checked and you catch the error immediately when you call it on iOS, but Android is indeed returning a timeout error code every time. We'll have a look and fix it! :)

If you still REALLY need to control permissions in a more fine-grained way, could you try the other plugin I suggested?

Thanks for the feedback, by the way, it really helps!

Carlos Simões

thank you for the good information and for the reply








gclub download