Ionic 2 + cordova keychain

Hi guys,

I am rookie in ionic and I need to use cordova keychain plugin (https://github.com/driftyco/cordova-plugin-ios-keychain). I installed it via CLI. Now I am not sure, where to put code from example file from github link posted above. Next problem is, how to call import declaration of cordova keychain. I have cordova keychain plugin in: plugins/cordova-plugin-ios-keychain.
I tried to import it (in app.components.ts):

import {Keychain} from ‘…/…/plugins/cordova-plugin-ios-keychain’;

but without success. Can someone give me please hints or link on tutorial how to make this plugin works? Thank you very much.

Hello!

My previous answer was very incorrect. It appears that you will need to, under your imports, add the line:

declare let Keychain:any;

which will allow you to use the plugin’s methods just by using Keychain.set() or others.