react-native-nfc-manager icon indicating copy to clipboard operation
react-native-nfc-manager copied to clipboard

Add ability to to selecting PollingOption on IOS

Open e-fadil opened this issue 1 year ago • 0 comments

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

e-fadil avatar Jan 12 '24 21:01 e-fadil