Hello again,
the new HCE function and listen() function both don't work because of one error.
Error:
TypeError: _reactNativeHce.default.getInstance is not a function. (In '_reactNativeHce.default.getInstance()',
'_reactNativeHce.default.getInstance' is undefined)
Issues with this line: const instance = await HCESession.getInstance();
old HCE function (works):
async function startSession() {
console.log("Session starts!");
const tag = new NFCTagType4(NFCContentType.Text, "Its working LOLLL Motherfuckers!!!");
session = await (new HCESession(tag)).start();
console.log("Successfull");
}
new listen() function:
const listen = async () => {
const removeListener = session.on(HCESession.Events.HCE_STATE_READ, () => {
ToastAndroid.show("The tag has been read! Thank You.", ToastAndroid.LONG);
});
removeListener();
}
old listen() function:
async function checkHCEStatus(){
const instance = await HCESession.getInstance();
const removeListener = instance.on(HCESession.Events.HCE_STATE_READ, () => {
ToastAndroid.show("The tag has been read! Thank You.", ToastAndroid.LONG);
removeListener();
});
}
The only difference between those two listen() functions is that the old one calls the instance itself and the new one uses the instance from the HCE function.
Hello again, the new
HCE function
andlisten()
function both don't work because of one error.Error:
Issues with this line:
const instance = await HCESession.getInstance();
old HCE function (works):
new
listen()
function:old
listen()
function:The only difference between those two listen() functions is that the old one calls the instance itself and the new one uses the instance from the HCE function.
Thanks for Help