Saturday, 27 May 2017

Check whether MOCK location is Enable or Not in CORDOVA?

Add plugin 

cordova-plugin-mock-location

Add this code in your index.js file

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
  window.plugins.mocklocation.check(successCallback, errorCallback);
}

function successCallback(result) {
  console.log(result); // true - enabled, false - disabled 
}

function errorCallback(error) {
  console.log(error);

}

1 comment: