Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

How to use Plugin

$
0
0

@ahback wrote:

Sorry, I am new in Ionic Developer, I had make a plug in with

cordova plugin add https://github.com/MorningCoffeeDev/ACR-NFC-Reader-PhoneGap-Plugin

but I don't know how to control the function inside the Plug in js

Do someone help me on it ?

The JS File content is
cordova.define("com.frankgreen.ACR-NFC-Reader-PhoneGap-Plugin", function(require, exports, module) { (function() {

var exec = require('cordova/exec');

var ACR = {};

ACR.TagSuccessListener = function() {};
ACR.TagFailureListener = function() {};
ACR.start = function() {
if (cordova.platformId === "android") { setTimeout(function() { cordova.exec(function(r) { //ACR.metadata = ACR.convertMetadata(r); //r.metadata = ACR.metadata; ACR.metadata = r.metadata; ACR.TagSuccessListener(r); }, function(r) { //ACR.metadata = {}; ACR.TagFailureListener(r); }, "ACRNFCReaderPhoneGapPlugin", "listen", []); }, 10); } };

})();
});

I just want to call "ACR.start" in Ionic angular function.

P/S: Full function is in https://github.com/MorningCoffeeDev/ACR-NFC-Reader-PhoneGap-Plugin/blob/master/www/ACR-NFC-Reader-PhoneGap-Plugin.js

Sorry for my english.

Thank you very much

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>