cordova-plugin-locationservices icon indicating copy to clipboard operation
cordova-plugin-locationservices copied to clipboard

add test to know if location is mocked

Open cvaliere opened this issue 8 years ago • 5 comments

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 avatar Mar 12 '16 11:03 cvaliere

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

cvaliere avatar Apr 06 '16 07:04 cvaliere

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?

louisbl avatar Apr 06 '16 11:04 louisbl

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 avatar Apr 06 '16 12:04 cvaliere

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

theavijitsarkar avatar Oct 08 '16 08:10 theavijitsarkar

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+

cvaliere avatar Oct 08 '16 12:10 cvaliere