HCE / Cordova HCE Plugin

Hello,
I am trying to install cordova-plugin-hce in my ionic v2 project.

I ran the following commands as mentioned in the document

  1. cordova plugin add cordova-plugin-hce --variable AID_FILTER=F222222222
  2. npm i cordova-plugin-hce

The plugin installed successfully.
But I am unable to import the plugin in my pages.

Such as,
import hce from 'cordova-plugin-hce’
declare var hce: any;

Above doesn’t work and I am stuck in here…
Please help.

1 Like

https://github.com/don/cordova-plugin-hce?

From what I see in the docs hce is a global Javascript object that you can just use. So the import won’t be needed.

Hi Sujan,
Without importing it is not letting me use the hce methods.
Can you please help me out using this plugin? I m stuck

1 Like

I have no experience here.

Look at and understand how Ionic Native works. Then you can write your own Ionic native plugin for this Cordova plugin and use it this way.

I would like to ask that can develop HCE in ionic 2?