From 18a633803be30754470da19e35ab516a8e966bd9 Mon Sep 17 00:00:00 2001 From: johanvanawesome <103578607+johanvanawesome@users.noreply.github.com> Date: Mon, 20 Jun 2022 14:50:06 +0200 Subject: [PATCH 1/2] Allow ISO 18092 tags Added NFCPollingISO18092 to polling options to allow scanning of these kinds of tags. --- src/ios/NfcPlugin.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ios/NfcPlugin.m b/src/ios/NfcPlugin.m index 9b40f251..8a07bccf 100644 --- a/src/ios/NfcPlugin.m +++ b/src/ios/NfcPlugin.m @@ -126,7 +126,7 @@ - (void)writeTag:(CDVInvokedUrlCommand*)command API_AVAILABLE(ios(13.0)){ NSLog(@"Using NFCTagReaderSession"); self.nfcSession = [[NFCTagReaderSession new] - initWithPollingOption:(NFCPollingISO14443 | NFCPollingISO15693) + initWithPollingOption:(NFCPollingISO14443 | NFCPollingISO15693 | NFCPollingISO18092) delegate:self queue:dispatch_get_main_queue()]; } else { @@ -307,7 +307,7 @@ - (void)startScanSession:(CDVInvokedUrlCommand*)command { if (self.shouldUseTagReaderSession) { NSLog(@"Using NFCTagReaderSession"); self.nfcSession = [[NFCTagReaderSession new] - initWithPollingOption:(NFCPollingISO14443 | NFCPollingISO15693) + initWithPollingOption:(NFCPollingISO14443 | NFCPollingISO15693 | NFCPollingISO18092) delegate:self queue:dispatch_get_main_queue()]; } else { NSLog(@"Using NFCNDEFReaderSession"); From ef6c356b145da5ae3dc105f744a4576e12c6fd4d Mon Sep 17 00:00:00 2001 From: johanvanawesome <103578607+johanvanawesome@users.noreply.github.com> Date: Fri, 18 Nov 2022 17:56:39 +0200 Subject: [PATCH 2/2] Update NfcPlugin.java fix for pending intent error --- .../src/com/chariotsolutions/nfc/plugin/NfcPlugin.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java b/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java index e8256d83..880eee45 100644 --- a/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java +++ b/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java @@ -482,8 +482,13 @@ private void createPendingIntent() { if (pendingIntent == null) { Activity activity = getActivity(); Intent intent = new Intent(activity, activity.getClass()); - intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); - pendingIntent = PendingIntent.getActivity(activity, 0, intent, 0); + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { + intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); + pendingIntent = PendingIntent.getActivity(activity, 0, intent, PendingIntent.FLAG_MUTABLE); + } else { + intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); + pendingIntent = PendingIntent.getActivity(activity, 0, intent, 0); + } } }