Skip to content
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

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

Closed
5 tasks done
Theamansinghrajput opened this issue Sep 24, 2022 · 11 comments
Closed
5 tasks done
Labels
android Relates to Android platform Cloud Messaging Related to Firebase FCM / Push Notifications / APNS runtime issue An issue related to app runtime

Comments

@Theamansinghrajput
Copy link

Theamansinghrajput commented Sep 24, 2022

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

Expected behavior:

Steps to reproduce:

Screenshots

Environment information

  • Cordova CLI version
    • cordova -v
  • Cordova platform version
    • cordova platform ls
  • Plugins & versions installed in project (including this plugin)
    • cordova plugin ls
  • Dev machine OS and version, e.g.
    • OSX
      • sw_vers
    • Windows 10
      • winver

Runtime issue

  • Device details
    • e.g. iPhone X, Samsung Galaxy S8, iPhone X Simulator, Pixel XL Emulator
  • OS details
    • e.g. iOS 12.2, Android 9.0

Android build issue:

  • Node JS version
    • node -v
  • Gradle version
    • ls platforms/android/.gradle
  • Target Android SDK version
    • android:targetSdkVersion in AndroidManifest.xml
  • Android SDK details
    • sdkmanager --list | sed -e '/Available Packages/q'

iOS build issue:

  • Node JS version
    • node -v
  • XCode version

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
Copy link

ollm commented Sep 26, 2022

Maybe related to this #763
Try this solution #765

@Theamansinghrajput
Copy link
Author

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

InShot_20220926_231527032.mp4

@ollm
Copy link

ollm commented Sep 27, 2022

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

@Theamansinghrajput
Copy link
Author

Theamansinghrajput commented Sep 27, 2022

@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
Copy link

ollm commented Sep 27, 2022

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
Copy link
Author

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

@Theamansinghrajput
Copy link
Author

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

@ollm
Copy link

ollm commented Sep 29, 2022

Don't you have in Firebase others errors?

@Theamansinghrajput
Copy link
Author

@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
Copy link

ollm commented Oct 5, 2022

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 dpa99c added runtime issue An issue related to app runtime android Relates to Android platform ready for release Something has been implemented and is awaiting release to npm Cloud Messaging Related to Firebase FCM / Push Notifications / APNS and removed ready for release Something has been implemented and is awaiting release to npm labels Nov 23, 2022
@dpa99c
Copy link
Owner

dpa99c commented Nov 23, 2022

Should be fixed in [email protected] which has just been released to npm

@dpa99c dpa99c closed this as completed Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Relates to Android platform Cloud Messaging Related to Firebase FCM / Push Notifications / APNS runtime issue An issue related to app runtime
Projects
None yet
Development

No branches or pull requests

3 participants