mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-20 01:22:52 +08:00
feat(IsDebug): add the IsDebug plugin (#475)
This commit is contained in:
parent
aa76fac3af
commit
dd39ba8c48
@ -53,6 +53,7 @@ import { ImageResizer } from './plugins/imageresizer';
|
||||
import { InAppBrowser } from './plugins/inappbrowser';
|
||||
import { Insomnia } from './plugins/insomnia';
|
||||
import { Instagram } from './plugins/instagram';
|
||||
import { IsDebug } from './plugins/is-debug';
|
||||
import { Keyboard } from './plugins/keyboard';
|
||||
import { LaunchNavigator } from './plugins/launchnavigator';
|
||||
import { LocalNotifications } from './plugins/localnotifications';
|
||||
@ -228,6 +229,7 @@ window['IonicNative'] = {
|
||||
ImageResizer: ImageResizer,
|
||||
InAppBrowser: InAppBrowser,
|
||||
Instagram: Instagram,
|
||||
IsDebug: IsDebug,
|
||||
Keyboard: Keyboard,
|
||||
LaunchNavigator: LaunchNavigator,
|
||||
LocalNotifications: LocalNotifications,
|
||||
|
35
src/plugins/is-debug.ts
Normal file
35
src/plugins/is-debug.ts
Normal file
@ -0,0 +1,35 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
/**
|
||||
* @name IsDebug
|
||||
* @description
|
||||
* Detect if the app is running in debug mode or not.
|
||||
* 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.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {IsDebug} from 'ionic-native';
|
||||
*
|
||||
* IsDebug.getIsDebug()
|
||||
* .then((isDebug: boolean) => console.log('Is debug:', isDebug))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-is-debug',
|
||||
pluginRef: 'cordova.plugins.IsDebug',
|
||||
repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug'
|
||||
})
|
||||
export class IsDebug {
|
||||
|
||||
/**
|
||||
* Determine if an app was installed via xcode / eclipse / the ionic CLI etc
|
||||
* @return {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.
|
||||
*/
|
||||
@Cordova()
|
||||
static getIsDebug(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user