cordova-plugin-developer-mode-check-alt
Version:
Cordova plugin for iOS to check if developer mode is enabled
38 lines (33 loc) • 939 B
JavaScript
var exec = require('cordova/exec');
/**
* Returns a detailed object of indicators.
* {
* simulator: boolean,
* debugger: boolean,
* dylib: boolean,
* mobileprovision: { exists: boolean, getTaskAllow: boolean|null },
* receipt: "missing"|"sandbox"|"production",
* any: boolean // true if any indicator suggests dev/test
* }
*/
function getIndicators(success, error) {
exec(success, error, 'DeveloperModeCheck', 'getIndicators', []);
}
/**
* Back-compat boolean API.
*/
function isEnabled(success, error) {
getIndicators(function (o) { success(!!o.any); }, error);
}
/**
* Optional: check if current location reading is simulated (iOS 15+).
* Returns boolean.
*/
function isLocationSimulated(success, error) {
exec(success, error, 'DeveloperModeCheck', 'isLocationSimulated', []);
}
module.exports = {
getIndicators: getIndicators,
isEnabled: isEnabled,
isLocationSimulated: isLocationSimulated
};