Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
How to add and use non native cordova plugin in ionic 5

I am trying to use this plugin in my Ionic 5 app: https://www.npmjs.com/package/cordova-plugin-k-nfc-acr122u

I installed plugin using cordova plugin add cordova-plugin-k-nfc-acr122u and i i dont now like use it. Plugin declares :

enter image description here

and i try use connect function but it don't work. enter image description here

package.json enter image description here

Please help, thx.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You can import the plugin KNfcAcr122U from cordova-plugin-k-nfc-acr122u in your component after importing in app.module.ts.

Then in constructor you can declare a private variable private kNfcAcr122U : KNfcAcr122U

and in you function:

this.kNfcAcr122U.connect()

and

this.kNfcAcr122U.disconnect()

about 4 years ago · Juan Pablo Isaza Relatório

0

I solved the problem myself, maybe it will be useful to someone, Import

 import { KNfcAcr122U } from 'plugins/cordova-plugin-k-nfc-acr122u/types';

I declare:

 const kNfcAcr122U: KNfcAcr122U = window['KNfcAcr122U'];

and I use the connect function:

kNfcAcr122U.connect(this.callbackSuccess, this.callbackError);

callbackSuccess(event): void {
  console.log(event,'success');  
}

callbackError(): void {
  console.log('error');
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda