NFC JavaScript Functions

You can find the JavaScript test page at https://www.android-kiosk.com/jstest.htm Just set this as the Kiosk URL on your device to test the functions.

Please note that only URL & text tag types are supported.

NFC Results via Callback
Register for the NFC scan/read callback. Once registered each scan result is sent via nfcScanResult(data). This callback PERSISTS page loads, so you may need to unregister the callback on other pages if you do not always want the results to be fed back to you via JavaScript (use false as parameter). Requires version 2.7.2 (build 252) or higher.

<script>
function registerForNFCScanResults() {
if (typeof Android != 'undefined') {
//tell KB to return results via JS function
Android.useJavaScriptCallbackNFC(true);
}
}

function nfcScanResult(data) {
console.log(data);
}
</script>
Was this article helpful?
Cancel
Thank you!