revtel / react-native-nfc-manager

React Native NFC module for Android & iOS
MIT License
1.33k stars 317 forks source link

Bug: restart polling on NFC tag connection error [iOS 16] #638

Closed storm2513 closed 1 year ago

storm2513 commented 1 year ago

Issue description:

After updating to iOS 16 in 50% cases we get error in requestTechnology call due to error in connecting to tag. It is easily reproducible if we move iPhone during NFC scanning.

What changes have been made?

Result

After applying this patch it works reliably and scans without any issues on iOS 16. Logs:

NFCTag didDetectTags
[CoreNFC] -[NFCTagReaderSession _connectTag:error:]:730 Error Domain=NFCError Code=100 "Tag connection lost" UserInfo={NSLocalizedDescription=Tag connection lost}
NFCTag restarting polling
NFCTag didDetectTags
[CoreNFC] -[NFCTagReaderSession _connectTag:error:]:730 Error Domain=NFCError Code=100 "Tag connection lost" UserInfo={NSLocalizedDescription=Tag connection lost}
NFCTag restarting polling
FCTag didDetectTags
// success

After connection error it immediately finds the same tag and connects again.

whitedogg13 commented 1 year ago

@storm2513 it's awesome, thanks!

whitedogg13 commented 1 year ago

@storm2513 this one has been included in latest v3.14.5 release, thanks!