Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Pin Dialog

Improve this doc

PhoneGap numeric password dialog plugin for Android and iOS.

Requires Cordova plugin: cordova-plugin-pin-dialog. For more info, please see the Pin Dialog plugin docs.

Repo: https://github.com/Paldom/PinDialog

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-pin-dialog
    $ npm install --save @ionic-native/pin-dialog@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { PinDialog } from '@ionic-native/pin-dialog';


constructor(private pinDialog: PinDialog) { }

...

this.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');
    }
  );

Instance Members

prompt(message, title, buttons)

Show pin dialog

Param Type Details
message string

Message to show the user

title string

Title of the dialog

buttons string[]

Buttons to show

Returns: Promise<{ buttonIndex: number, input1: string }>

API

Native

General