Showing results for 
Search instead for 
Did you mean: 

XDK, NFC plugin, functions are not defined

Hello all,
I have a problem with my first simple application in Intel XDK. It is very simple test program for NFC.
For this I have installed the phonegap-nfc plugin.

In index.html file I have only one button which call the javascript function:

<meta http-equiv="Content-type" content="text/html; charset=utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  @-ms-viewport { width: 100vw ; zoom: 100% ; }  @viewport { width: 100vw ; zoom: 100% ; }
  @-ms-viewport { user-zoom: fixed ; }           @viewport { user-zoom: fixed ; }

<script src="cordova.js"></script>          
<script src="js/app.js"></script>           
<script src="xdk/init-dev.js"></script>    

<p>Unicate App</p>
<input type="submit" value="Write" onClick="writeNDEF">


In the app.js file is also very simply functions which prepare the message "unicate test" and the write it:

function onAppReady()
    if( navigator.splashscreen && navigator.splashscreen.hide ) {   // Cordova API detected
       navigator.splashscreen.hide() ;

document.addEventListener("app.Ready", onAppReady, false) ;

function onSuccess() {

    window.alert("Send success"); }

function onFailure() {

    window.alert("Send errors");  }

function writeNDEF() {

var message = [
    ndef.textRecord("Unicate test")

nfc.write(message, [onSuccess], [onFailure]);    


The problem is that there is a error message "ndef is not defined (w117)" and "nfc is not defined".
Can you tell me why it not connected to the plugin phonegap-nfc?

Do you have any idea what I am doing wrong?

Thank you very much for your help.

BR Lukas



Tags (2)
0 Kudos
1 Reply

Those are JS Hint problems you are seeing. See the "Blank Cordova Starter App" and the "Hello Cordova App" in the "samples and demos" section of "start a new project" for an example of how to deal with JS Hint errors and how to build a simple Cordova app. Also, see the JS Hint documentation > <