Android Question FB Notifications 2.01 + B4A 11.80 - Target sdk 31 error

tufanv

Expert
Licensed User
Longtime User
Hello,

I have used b4a 11.80 as suggested with the latest fb notifications 2.01. Now when I send a notification with firebase I get spiking errors alert from firebase crashlytics with these:

B4X:
Fatal Exception: java.lang.IllegalArgumentException
ct.canlidoviz: 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.

Checked the forum but most of the messages are saying that using b4a 11.80 should fix the problem. What am I doing wrong here?
 

tufanv

Expert
Licensed User
Longtime User
Is this the full error message?
B4X:
Fatal Exception: java.lang.IllegalArgumentException
ct.canlidoviz: 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.
android.app.PendingIntent.checkFlags (PendingIntent.java:382)
android.app.PendingIntent.getActivityAsUser (PendingIntent.java:465)
android.app.PendingIntent.getActivity (PendingIntent.java:451)
android.app.PendingIntent.getActivity (PendingIntent.java:415)
com.google.firebase.messaging.CommonNotificationBuilder.createContentIntent (com.google.firebase:firebase-messaging@@20.3.0:125)
com.google.firebase.messaging.CommonNotificationBuilder.createNotificationInfo (com.google.firebase:firebase-messaging@@20.3.0:27)
com.google.firebase.messaging.CommonNotificationBuilder.createNotificationInfo (com.google.firebase:firebase-messaging@@20.3.0:9)
com.google.firebase.messaging.DisplayNotification.handleNotification (com.google.firebase:firebase-messaging@@20.3.0:27)
com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage (com.google.firebase:firebase-messaging@@20.3.0:65)
com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk (com.google.firebase:firebase-messaging@@20.3.0:44)
com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent (com.google.firebase:firebase-messaging@@20.3.0:27)
com.google.firebase.messaging.FirebaseMessagingService.handleIntent (com.google.firebase:firebase-messaging@@20.3.0:17)
com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService (com.google.firebase:firebase-messaging@@20.3.0:43)
com.google.firebase.messaging.EnhancedIntentService$$Lambda$0.run (Unknown Source:6)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1137)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:637)
com.google.android.gms.common.util.concurrent.zza.run (com.google.android.gms:play-services-basement@@17.6.0:2)
java.lang.Thread.run (Thread.java:1012)
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
It looks like you are sending non-data messages, right?

The error happens inside Firebase SDK. Upgrade to B4A v12.0 with an updated SDK.
Yes that is correct. I will try with the new version. Thanks Erel
 
Upvote 0
Top