-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Android 12 - FLAG_IMMUTABLE or FLAG_MUTABLE #466
base: master
Are you sure you want to change the base?
Fix Android 12 - FLAG_IMMUTABLE or FLAG_MUTABLE #466
Conversation
The plugin works perfectly in all devices except for Andorid 12. I get following error ``` Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent ``` I see the problem is in `createPendingIntent` Method ``` 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); // Problem in the last param here } } ``` This PR solves the problem by just adding the requried flag which also works for lower android versions
@don hey, by any chance can you look at this PR please? It will be very very helpful. |
I confirm this bug happens on Android 12 and hardcrashes any app with thepluging. In the meantime: [...]
"dependencies": {
"phonegap-nfc": "SachinAgarwal1337/phonegap-nfc#patch-1",
[...]
} (Ping @don) |
I am also confirming on this bug, and it is blocker for using the plugin in Android 12 + (12 or 13 beta). (Ping @don ) |
Hi @don, @krimple, @gonzalo123, @doncoleman - any updates on this? |
Hi @don @gonzalo123 @doncoleman - Any update on this? |
Any Update??? |
Already included in #460, thus this PR could be closed as duplicate. |
The plugin works perfectly in all devices except for Andorid 12.
I get following error
I see the problem is in
createPendingIntent
MethodThis PR solves the problem by just adding the requried flag which also works for lower android versions
Solve the issue I raised #465