363
Views
4
Comments
[Location Plugin] CheckLocationPlugin method
location-plugin
Mobile icon
Forge asset by OutSystems

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.


2018-05-10 22-41-57
Carlos Filipe Simões
Staff

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

2019-11-06 08-51-48
Hugo Antunes

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

2018-05-10 22-41-57
Carlos Filipe Simões
Staff

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

UserImage.jpg
Joey Bosteen

thank you for the good information and for the reply








gclub download

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.