How to use ionic-native with ionic2?

Hi,

I would like to use the PinDialog described here: http://ionicframework.com/docs/v2/native/pin-dialog/ with ionic2. I tried the following steps:

  1. npm install ionic-native --save
  2. ionic plugin add cordova-plugin-pin-dialog
  3. import {PinDialog} from “ionic-native”;
  4. ionic state reset

I got the following error:

TypeScript error: app/app.ts(38,9): Error TS2305: Module '"...ionic-native/dst/index"' has no exported member 'PinDialog'.

I also tried to add cordova-plugin-pin-dialog manually to my package.json but it didn’t help.

What version of ionc-native do you have installed?

the version is 1.2.4

Alrighty, well the PinDalog plugin was added to ionic-native in version 1.3.5.

So I’d update your package.json to point to the latest version of ionic-native (“1.3.21”) and then run npm install and you should be good to go!

1 Like

It works now. Thanks a lot.