Not sure what is the problem with hexToDec and then hex.toLowerCase, is it because my tag contains non-standard record maybe? I am guessing this case when I tried to read this tag with other apps it saying 'error data' or not displaying anything... but other native apps from Apple Store at least do not crash badly like mine.
evaluating 'hex.toLowerCase'
My knowledge of NFC data payload is tiny. What I've done and it's not crashing the app, I went to
nativescript-nfc/nfc.ios.js and commented this bit o code
NFCNDEFReaderSessionDelegateImpl.prototype.hexToDec = function (hex) {
//let result = 'Dupa';
var result = 0, digitValue;
//
// console.log('HEX??', hex)
//
// hex = hex.toLowerCase();
// for (var i = 0; i < hex.length; i++) {
// digitValue = '0123456789abcdefgh'.indexOf(hex[i]);
// result = result * 16 + digitValue;
// }
return result;
};
Yeah, I guess that value is not OK, and therefore NativeScript gets an undefined hex value from the iOS SDK. Let's no longer attempt to lowercase that ;)
Hi! My iOS app built with nativescript vuejs template crashes, this is last bit of log:
and this is template App.vue component:
Not sure what is the problem with hexToDec and then hex.toLowerCase, is it because my tag contains non-standard record maybe? I am guessing this case when I tried to read this tag with other apps it saying 'error data' or not displaying anything... but other native apps from Apple Store at least do not crash badly like mine.
My knowledge of NFC data payload is tiny. What I've done and it's not crashing the app, I went to nativescript-nfc/nfc.ios.js and commented this bit o code
Now my app does not crash and the result is
So it looks like hexToDec function needs some extra tweaks. Also I have found interesting article regarding NFC, would be great at some point to implement some solutions like this https://medium.com/@vinceyuan/reading-and-parsing-nfc-tag-on-ios-11-60f4bc7a11ea - anyways any help, much appreciated.