dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
571 stars 462 forks source link

Onclick Listener of FCM is not working on foreground mode : ANDROID 12 #764

Closed Theamansinghrajput closed 1 year ago

Theamansinghrajput commented 1 year ago

Bug report

CHECKLIST

Current behavior:

Expected behavior:

Steps to reproduce:

Screenshots

Environment information

Runtime issue

Android build issue:

iOS build issue:

Related code:

insert any relevant code here such as plugin API calls / input parameters

Console output

console output ``` // Paste any relevant JS/native console output here ```


**Other information:**
ollm commented 1 year ago

Maybe related to this #763 Try this solution #765

Theamansinghrajput commented 1 year ago

@ollm Now foreground alert is visible but click is still crashing the app. Check the attachment...

https://user-images.githubusercontent.com/109267226/192345888-1e9a0cf3-c9c0-493b-b473-52660a53a9c7.mp4

ollm commented 1 year ago

@Theamansinghrajput Can you put the stack trace from Firebase Crashlytics or Android Studio Logcat? to see what produces the crash.

Theamansinghrajput commented 1 year ago

@ollm

Non-fatal Exception: java.lang.IllegalArgumentException: com.labs.networks: 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:375) at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:651) at android.app.PendingIntent.getBroadcast(PendingIntent.java:638) at org.apache.cordova.firebase.FirebasePluginMessagingService.sendMessage(FirebasePluginMessagingService.java:240) at org.apache.cordova.firebase.FirebasePluginMessagingService.onMessageReceived(FirebasePluginMessagingService.java:203) at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(com.google.firebase:firebase-messaging@@23.0.0:12) at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(com.google.firebase:firebase-messaging@@23.0.0:8) at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(com.google.firebase:firebase-messaging@@23.0.0:3) at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(com.google.firebase:firebase-messaging@@23.0.0:3) at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$com-google-firebase-messaging-EnhancedIntentService(com.google.firebase:firebase-messaging@@23.0.0:1) at com.google.firebase.messaging.EnhancedIntentService$$ExternalSyntheticLambda1.run(:6) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@18.0.0:2) at java.lang.Thread.run(Thread.java:1012)

ollm commented 1 year ago

Are you using the latest version of the plugin? this bug is the same as this #746 and it is fixed in the latest versions 14.2.0+

Theamansinghrajput commented 1 year ago

Not fixed yet i am using updated plugin... @ollm

Theamansinghrajput commented 1 year ago

issue is still on foreground click. Background notification click is working fine but foreground notification click is crashing the application. @ollm @dpa99c

ollm commented 1 year ago

Don't you have in Firebase others errors?

Theamansinghrajput commented 1 year ago

@ollm After testing the main issue with launch-mode, plugin is not working on standard launch mode, this is working on singletask, singletop on both foreground and background.

ollm commented 1 year ago

You should talk to @dpa99c, I don't have enough knowledge about the plugin to be able to help you find the cause of the error, sorry.

dpa99c commented 1 year ago

Should be fixed in cordova-plugin-firebasex@15.0.0 which has just been released to npm