revtel / react-native-nfc-manager

React Native NFC module for Android & iOS
MIT License
1.32k stars 312 forks source link

Add ability to to selecting PollingOption on IOS #691

Closed e-fadil closed 2 months ago

e-fadil commented 6 months ago

Hi,

would it possible on IOS to be able to specify the NFC polling options when using NFC IOS.

The issue is that some cards have both NFCPollingISO14443 & NFCPollingISO15693 chips for different use cases, but in the app we only want to select NFCPollingISO14443.

It would be useful to be able to specify to poll for either NFCPollingISO14443, NFCPollingISO15693 or both.

In the meantime i've had to disable the polling for NFCPollingISO15693 using patch-package.

diff --git a/node_modules/react-native-nfc-manager/ios/NfcManager.m b/node_modules/react-native-nfc-manager/ios/NfcManager.m
index a63e4d9..4809947 100755
--- a/node_modules/react-native-nfc-manager/ios/NfcManager.m
+++ b/node_modules/react-native-nfc-manager/ios/NfcManager.m
@@ -288,7 +288,7 @@ RCT_EXPORT_METHOD(requestTechnology: (NSArray *)techs options: (NSDictionary *)o
 {
     if (@available(iOS 13.0, *)) {
         if (tagSession == nil && session == nil) {
-            NFCPollingOption pollFlags = NFCPollingISO14443 | NFCPollingISO15693;
+            NFCPollingOption pollFlags = NFCPollingISO14443;
             if ([techs containsObject:@"felica"]) {
                 pollFlags |= NFCPollingISO18092;
             }

Thank you

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 5 days with no activity.