Search code examples
phonegapcapacitorcapacitor-plugin

phonegap-nfc running without ionic in capacitor project


Is there a way to run this project without useing ionic underlaying? I am using vanilla js and wrap it into a native app using capacitor.js. However it seems to require IONIC underlaying..

Library Link to Phonegap-nfc.

Cheers


Solution

  • You don't need Ionic for that. Ionic is just a UI library and has nothing to do with the plugin itself. Your link just points to a TypeScript wrapper originally created by Ionic (this project is now called awesome-cordova-plugins).

    You can also just use the actual plugin directly: https://github.com/chariotsolutions/phonegap-nfc

    Example:

    window.nfc.scanTag();