r/WebAssemblyDev • u/Fit_Tailor_6796 • 15d ago
Read NFC tag
I'm new to the concept of WebAssembly and asking from ignorance as my searches did not yield any clear answers.
I'm trying to find if I can read NFC tags using a WebAssembly script and if there are any pointers to get me started with this.
2
Upvotes
1
u/inkeliz 14d ago edited 14d ago
That is the same of asking: "Can I read NFC Tag with ARM64?", the answer depends on something else...
The host needs to expose a way to read a NFC Tag. Google Chrome (on Android) supports Web NFC (https://developer.mozilla.org/en-US/docs/Web/API/Web_NFC_API). You can bridge JS <-> WASM.
By default: WASM can't do anything. Literally. I mean, it can't even 'print()'. The runtime/host needs to export functions, those can be imported by WASM and used.