-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hey,
awesome work! This is exactly what I need. After installing this with cordova plugin add https://github.com/Legenyes/cordova-nfc-acr122-plugin the onDeviceReady is firing. A second later: Class not found. I´m not sure what this error means...
This is the index.js
/* global tagIdDiv */
var nfc = {
addTagIdListener: function (success, failure) {
cordova.exec(success, failure, "NfcIdPlugin", "listen", []);
}
}
var app = {
initialize: function() {
alert("initialize");
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
alert("onDeviceReady");
console.log("Device Ready");
var success = function(result) {
if (result) {
//alert(result);
//navigator.notification.alert(result, function() {}, "NFC Tag ID");
tagIdDiv.innerHTML = result;
}
};
var failure = function(reason) {
alert ("Error " + JSON.stringify(reason))
};
console.log("Calling plugin");
nfc.addTagIdListener(success, failure);
console.log("Called plugin");
}
};
Metadata
Metadata
Assignees
Labels
No labels