cordova-plugin-locationservices
cordova-plugin-locationservices copied to clipboard
add test to know if location is mocked
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 :)
@louisbl, are you interested? if not, I close this pull request
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?
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
@cvaliere why dont you make a seperate plugin to detect mock location, let this one be just for getting location
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+