Ionic Framework 4 is almost here. Preview the beta docs and try it out now! Try Ionic 4 Beta

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.



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

Supported platforms


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

constructor(private pinDialog: PinDialog) { }


this.pinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel'])
    (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 }>