When the function requestUSBPermissions() is called in Android 12 - API 31 the app Crashes and close with the follow log:
E/AndroidRuntime: FATAL EXCEPTION: pool-3-thread-1
Process: xxxx.xxxxx.xxxx, PID: 3490
java.lang.IllegalArgumentException: com.nextqs.app: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:382)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:673)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:660)
at de.paystory.thermal_printer.ThermalPrinterCordovaPlugin.requestUSBPermissions(ThermalPrinterCordovaPlugin.java:9😎
at de.paystory.thermal_printer.ThermalPrinterCordovaPlugin.lambda$execute$0$de-paystory-thermal_printer-ThermalPrinterCordovaPlugin(ThermalPrinterCordovaPlugin.java:60)
at de.paystory.thermal_printer.ThermalPrinterCordovaPlugin$$ExternalSyntheticLambda0.run(Unknown Source:😎
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
https://github.com/paystory-de/thermal-printer-cordova-plugin/blob/81cae42d3d3746fb577c030b0516875c88ee8116/src/android/ThermalPrinterCordovaPlugin.java#L93
When the function requestUSBPermissions() is called in Android 12 - API 31 the app Crashes and close with the follow log: