mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-16 16:43:50 +08:00
feat(pin-dialog): add pin dialog plugin (#291)
This commit is contained in:
parent
be1725d2eb
commit
2fe37c461c
@ -54,6 +54,7 @@ import {LocalNotifications} from './plugins/localnotifications';
|
|||||||
import {MediaPlugin} from './plugins/media';
|
import {MediaPlugin} from './plugins/media';
|
||||||
import {Network} from './plugins/network';
|
import {Network} from './plugins/network';
|
||||||
import {OneSignal} from './plugins/onesignal';
|
import {OneSignal} from './plugins/onesignal';
|
||||||
|
import {PinDialog} from './plugins/pin-dialog';
|
||||||
import {Printer} from './plugins/printer';
|
import {Printer} from './plugins/printer';
|
||||||
import {Push} from './plugins/push';
|
import {Push} from './plugins/push';
|
||||||
import {SafariViewController} from './plugins/safari-view-controller';
|
import {SafariViewController} from './plugins/safari-view-controller';
|
||||||
@ -128,6 +129,7 @@ export {
|
|||||||
Keyboard,
|
Keyboard,
|
||||||
Network,
|
Network,
|
||||||
OneSignal,
|
OneSignal,
|
||||||
|
PinDialog,
|
||||||
Screenshot,
|
Screenshot,
|
||||||
SocialSharing,
|
SocialSharing,
|
||||||
Splashscreen,
|
Splashscreen,
|
||||||
@ -193,6 +195,7 @@ window['IonicNative'] = {
|
|||||||
Printer: Printer,
|
Printer: Printer,
|
||||||
Push: Push,
|
Push: Push,
|
||||||
OneSignal: OneSignal,
|
OneSignal: OneSignal,
|
||||||
|
PinDialog: PinDialog,
|
||||||
SafariViewController: SafariViewController,
|
SafariViewController: SafariViewController,
|
||||||
Screenshot: Screenshot,
|
Screenshot: Screenshot,
|
||||||
SMS: SMS,
|
SMS: SMS,
|
||||||
|
37
src/plugins/pin-dialog.ts
Normal file
37
src/plugins/pin-dialog.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import {Plugin, Cordova} from './plugin';
|
||||||
|
/**
|
||||||
|
* @name Pin Dialog
|
||||||
|
* @description
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import {PinDialog} from 'ionic-native';
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* PinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel'])
|
||||||
|
* .then(
|
||||||
|
* (result: any) => {
|
||||||
|
* if(result.buttonIndex == 1) console.log('User clicked OK, value is: ', result.input1);
|
||||||
|
* else if(result.buttonIndex == 2) console.log('User cancelled');
|
||||||
|
* }
|
||||||
|
* );
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
plugin: 'cordova-plugin-pin-dialog',
|
||||||
|
pluginRef: 'plugins.pinDialog',
|
||||||
|
repo: 'https://github.com/Paldom/PinDialog'
|
||||||
|
})
|
||||||
|
export class PinDialog {
|
||||||
|
/**
|
||||||
|
* Show pin dialog
|
||||||
|
* @param {string} message Message to show the user
|
||||||
|
* @param {string} title Title of the dialog
|
||||||
|
* @param {string[]} buttons Buttons to show
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
successIndex: 1
|
||||||
|
})
|
||||||
|
static prompt(message: string, title: string, buttons: string[]): Promise<{buttonIndex: number, input1: string}> {return; }
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user