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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test to know if location is mocked #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

add test to know if location is mocked #18

wants to merge 6 commits into from

Conversation

cvaliere
Copy link
Contributor

Hi @louisbl
I added a test to know if location is mocked (by FakeGPS or something else)
Dunno if you're interested in this feature, but I needed it anyway :)

@cvaliere
Copy link
Contributor Author

cvaliere commented Apr 6, 2016

@louisbl, are you interested?
if not, I close this pull request

@louisbl
Copy link
Owner

louisbl commented Apr 6, 2016

It could be usefull but it means this plugin no longer strictly follow the Geolocation API specification.

Also it appears there is no way to know if a Location has been mocked before SDK 18? It just check if it could have been mocked, right?

@cvaliere
Copy link
Contributor Author

cvaliere commented Apr 6, 2016

yes, from API 18 it is possible to know if location is mocked, before it is only possible to know that mocked locations are authorized on this device
I would totally understand if you reject this PR, because it's kinda hacky, but it is useful for me, so I'll keep it anyway in my own fork

@theavijitsarkar
Copy link

@cvaliere why dont you make a seperate plugin to detect mock location, let this one be just for getting location

@cvaliere
Copy link
Contributor Author

cvaliere commented Oct 8, 2016

the thing is, it's when I get the location, in Java, that I'm able to know if it's mocked or not (with Java method isFromMockProvider() )
thus, I don't see how you would want to separate it?

Note: my fork also contains a NullPointerException fix for Android 6+

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

Successfully merging this pull request may close these issues.

4 participants