NFC javascript on PWA error: Cannot read properties of undefined (reading NfcManager)

1
I try to implement the javascirpt action as descriped by mendix in the following documentation.   https://docs.mendix.com/howto/extensibility/create-native-javascript-action/    I followed the steps but when testing it on PWA I get the following error:     Has this something todo with the library that is only suitable for native or is it caused by something else?   Hereby my code snippets of the javaactions:   // This file was generated by Mendix Studio Pro. // // WARNING: Only the following code will be retained when actions are regenerated: // - the import list // - the code between BEGIN USER CODE and END USER CODE // - the code between BEGIN EXTRA CODE and END EXTRA CODE // Other code you write will be lost the next time you deploy the project. import "mx-global"; import { Big } from "big.js"; import { NativeModules } from "react-native"; import NfcManager from "react-native-nfc-manager"; // BEGIN EXTRA CODE // END EXTRA CODE /** * @returns {Promise.<boolean>} */ export async function HasNFCSupport() { // BEGIN USER CODE if (!NativeModules.NfcManager) { throw new Error("The NfcManager module is not available in your app."); } return NfcManager.isSupported(); // END USER CODE } // This file was generated by Mendix Studio Pro. // // WARNING: Only the following code will be retained when actions are regenerated: // - the import list // - the code between BEGIN USER CODE and END USER CODE // - the code between BEGIN EXTRA CODE and END EXTRA CODE // Other code you write will be lost the next time you deploy the project. import "mx-global"; import { Big } from "big.js"; import NfcManager, { Ndef } from "react-native-nfc-manager"; // BEGIN EXTRA CODE // END EXTRA CODE /** * @returns {Promise.<string>} */ export async function ReadNFCTag() { // BEGIN USER CODE return new Promise(resolve => { NfcManager.registerTagEvent(tag => { NfcManager.unregisterTagEvent(); const text = Ndef.text.decodePayload(tag.ndefMessage[0].payload); resolve(text); }); }); // END USER CODE }   And here a screenshot of my app directory > javascriptsource > NFC > actions    How to make this work for PWA?  
asked
0 answers