From fc9f03aadebd0f66e9f92889f774e09d4a870a99 Mon Sep 17 00:00:00 2001 From: iabdullahbeker <52360390+iabdullahbeker@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:01:19 +0200 Subject: [PATCH 1/2] Fix Android App crashing --- src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java b/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java index e8256d83..198a7bc5 100644 --- a/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java +++ b/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java @@ -483,7 +483,7 @@ private void createPendingIntent() { 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); + pendingIntent = PendingIntent.getActivity(activity, 0, intent, PendingIntent.FLAG_IMMUTABLE); } } From 617ff2bfeec75b436fce1557cdd2e64a6673775f Mon Sep 17 00:00:00 2001 From: iabdullahbeker <52360390+iabdullahbeker@users.noreply.github.com> Date: Fri, 16 Feb 2024 13:08:51 +0200 Subject: [PATCH 2/2] Use FLAG_MUTABLE instead of FLAG_IMMUTABLE FLAG_IMMUTABLE it's not working when on event trigger. but FLAG_MUTABLE it's tested and works fine --- src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java b/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java index 198a7bc5..d6d32089 100644 --- a/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java +++ b/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java @@ -483,7 +483,7 @@ private void createPendingIntent() { 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, PendingIntent.FLAG_IMMUTABLE); + pendingIntent = PendingIntent.getActivity(activity, 0, intent, PendingIntent.FLAG_MUTABLE); } }