1 year ago

#275591

test-img

zeuschyant8

sendMifareCommand() API randomly returns various errors

To read from an Mifare Ultralight tag (NTAG I2C Plus), I'm using NFCMifareTag.sendMifareCommand method. It works most of the times, but I randomly get errors of type Tag Response Error / Tag No Response / Tag Connection Lost / Stack error. I haven't been able to find a pattern or root cause of these errors, and there is no help available on Apple's documentation for these errors.

Here's the code snippet (using Xamarin)

            miFareTag.SendMiFareCommand(tagCommand, completionHandler: (nsdataObj, error1) =>
            {
                if ((error1 == null) && (nsdataObj != null))
                {
                    readSuccess = true;
                }
                else
                {
                    readSuccess = false;
// here error1 prints 'Tag response error' or 'Tag no response' or 'Tag connection lost' or 'Stack error'
                }
            });

One thing I'm sure about is the errors are not related to phone's position against the NFC tag. No matter how close I hold the phone, the errors do come up randomly. I've also observed these errors to occur more frequently on iPhone 13 models than the older ones.

Has anyone observed these errors and is aware about way to avoid / handle those?

ios

mifare

core-nfc

0 Answers

Your Answer

Accepted video resources