This is a cordova plugin to avoid mock locations
This plugin get mock location in Android api <= 22 AND api > 22
- Android API all versions
cordova plugin add cordova-plugin-mockchecker
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
mockchecker.check(successCallback, errorCallback);
}
function successCallback(mockStatus) {
console.log(mockStatus);
}
function errorCallback(error) {
console.log(error);
}
Contains mock status :
- isMock : (boolean) true if device mock, false if no mock behavior detected.
- messages : (string) this properties exists if isMock properties values is true.