question

zeuschyant88-7033 avatar image
0 Votes"
zeuschyant88-7033 asked WenyanZhang-MSFT commented

Is there a way to increase timeout for 'NFCMifareTag.SendMiFareCommand()'?

I'm working on an NFC app for R&W operations on an NFC tag.

All R&W operations work fine with the 'SendMiFareCommand()' API, however there's a special command for 'password authentication' process where it fails with a timeout, may be because the NFC tag is not responding in time.

This issue is not observed every time, so I'm sure about the command I'm sending and how its response is to be processed. Moreover, this issue appears more frequently on iPhone 12 & 13 than older ones, may be because they changed something at the NFC lower layer.

Anyway, Android allows adjusting timeout which is usually done before sending any command, so that it gets enough time to respond and the session remains active. It's typically done as - mifareTag.Timeout = timeout_value_ms;

Can this be done for iOS? I could not find much in their API documentation.

dotnet-xamarinformsdotnet-ios
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

May I know if you have got any chance to check my answer? I am glad to help if you have any other questions.

0 Votes 0 ·

1 Answer

WenyanZhang-MSFT avatar image
0 Votes"
WenyanZhang-MSFT answered WenyanZhang-MSFT edited

Hello,

Welcome to our Microsoft Q&A platform!

I have to say that Apple doesn't provide an API to set the session timeout. Tag scans must be user-initiated, and time-out after 60 seconds. It dependents on the iOS feature, you could report a new feature request to Apple Developer Forums.
There is a NFCReaderSessionInvalidationErrorSessionTimeout error, I think you need to handle this error and prompt to send commands again.


Best Regards,
Wenyan Zhang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.