UNPKG

2.1 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name IsDebug
11 * @description
12 * Detect if the app is running in debug mode or not.
13 * Debug mode is when the app is built and installed locally via xcode / eclipse / the cordova cli etc, compared to release mode when the app was downloaded from the app / play store via an end user.
14 *
15 * @usage
16 * ```
17 * import {IsDebug} from 'ionic-native';
18 *
19 * IsDebug.getIsDebug()
20 * .then((isDebug: boolean) => console.log('Is debug:', isDebug))
21 * .catch((error: any) => console.error(error));
22 *
23 * ```
24 */
25var IsDebug = (function () {
26 function IsDebug() {
27 }
28 /**
29 * Determine if an app was installed via xcode / eclipse / the ionic CLI etc
30 * @returns {Promise<boolean>} Returns a promise that resolves with true if the app was installed via xcode / eclipse / the ionic CLI etc. It will resolve to false if the app was downloaded from the app / play store by the end user.
31 */
32 IsDebug.getIsDebug = function () {
33 return;
34 };
35 __decorate([
36 plugin_1.Cordova()
37 ], IsDebug, "getIsDebug", null);
38 IsDebug = __decorate([
39 plugin_1.Plugin({
40 pluginName: 'IsDebug',
41 plugin: 'cordova-plugin-is-debug',
42 pluginRef: 'cordova.plugins.IsDebug',
43 repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug'
44 })
45 ], IsDebug);
46 return IsDebug;
47}());
48exports.IsDebug = IsDebug;
49//# sourceMappingURL=is-debug.js.map
\No newline at end of file