Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only works in high accuracy mode? #67

Open
JCKodel opened this issue Sep 19, 2018 · 6 comments
Open

Only works in high accuracy mode? #67

JCKodel opened this issue Sep 19, 2018 · 6 comments

Comments

@JCKodel
Copy link

JCKodel commented Sep 19, 2018

On Android 5.1, when I disable the 馃搷 Location icon and re-enable, this dialog is displayed:

image

If I hit Agree, everything works fine. If I hit Disagree, error 100 (GPS and Network are disabled)

@andygup
Copy link
Member

andygup commented Sep 20, 2018

If you Disagree can you enable the location permissions directly within the application? I think that's how Android 5.1 works...it's been a long time since I've used that version.

@JCKodel
Copy link
Author

JCKodel commented Sep 20, 2018

Now it gives me a 140: Network provider is not available.

I'm requesting "all" providers. Disagree means only GPS, AFAIK, thus, with network "disagreed", the error 140 is issued (although I have GPS because Location is on).

Where those errors come from? Android or plugin's code?

I'm only interest in a coordinate. I don't really care where it come from (that's what accuracy property stands for). There should be no error issued if one of the providers gave me a coordinate =\

@andygup
Copy link
Member

andygup commented Sep 20, 2018

That error is from the plugin, it's telling you can't request data from all Android Location providers and then not have a network available.

Have you tried using just "providers": "gps"?

Here's the doc that explains the different options: https://github.com/Esri/cordova-plugin-advanced-geolocation#use-cases

@JCKodel
Copy link
Author

JCKodel commented Sep 20, 2018

More on that:

My settings are for providers: "some" (I was hoping that some means, give me something, please please please)

With Location off, it gives me a 140 (Network location requested but the provider is not available. Check system Location settings). Sometimes it gives me a 120 (but only sometimes)

With location on and I disagree to use network to improve my location, it gives me 140 (ok, I explicitly disagree to use network, so don't nag me with an error >.<).

I would expect that "some" would ignore the error for network provider not available and return me a location from gps provider.

What I'll try next is to instantiate 3 separate start(), one for each provider =\ Whoever answers me, I'm taking! Try to figure out the best option with accuracy, if it is set =\

@JCKodel
Copy link
Author

JCKodel commented Sep 20, 2018

"providers": "gps" works fine. (including caching the position - after the first result, I can disable location and still get a cached position).

I would just recommend to change the behavior of "providers": "some" to get all the providers that you can and, if more than one, decide wich by accuracy.

So, in case anyone having the same problem: use "gps" and be happy =P

@andygup
Copy link
Member

andygup commented Sep 20, 2018

Glad it worked. Good suggestion. I'm not planning on making any changes to this plugin in the near-term, however I always welcome pull requests 馃槈! I'll leave this issue open as an enhancement request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants