Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Class not found #1

Open
w3development-kn opened this issue Apr 11, 2017 · 1 comment
Open

Class not found #1

w3development-kn opened this issue Apr 11, 2017 · 1 comment

Comments

@w3development-kn
Copy link

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");

    }
};

@abelrsuing
Copy link

@micrdy Can I know what Cordova version you are using?

Because it's error on my side, I'm using Cordova version 8.0.0 & Android version 6.4.0

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants