Can the Web NFC api be used in Progressive Web Applications?

Stan Hurks picture Stan Hurks · Jul 2, 2018 · Viewed 11.4k times · Source

I need to implement NFC (near field communication) in a PWA (progressive webapplication)

Every browser I have tested (Chrome MacOSX, Safari MacOSX, Safari iOS, Chrome for android) does not include the navigator.nfc object in navigator and it seems impossible to make use of this API: https://w3c.github.io/web-nfc/#conformance.

Is it possible to use NFC in any way in a PWA? Or do I have to develop a native application for this functionality?

Answer

Anand picture Anand · Jul 2, 2018

Web NFC API is available only in Chrome for Android and that too when a flag is enabled(try about:flags) enabled.

Unless you are targeting your app for some internal corporate app where you can set the flag in all targeted users browser, I would recommend go with native code or wrapper(cordova or have a native app send in the details via web sockets)

This API is not making much progress since 2015 and so you can expect no magic to happen anytime soon. So don't rely on this API if you are targeting this for a critical app, especially when you cant control the end users browser settings.