Android Question Error receiving message firebaseMessaging Targeting S+

Status
Not open for further replies.

Snoop

Member
I made changes as DonManfred once guided me by adding the receiver to receive notification. and in parts it worked. When the app is open I am able to receive the message normally now.

View attachment 139307

But if I close and send the message it gives me the following error:

java.lang.IllegalArgumentException: big2be.unifruti.local.android: 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.


If you need the complete code, i send it here. I was reading something with NB6 but I have no idea how to convert from FirebaseMessaging library to NB6.

Thank you for attention.
 

Snoop

Member
1676404366197.png
 
Upvote 0

Snoop

Member
bom Dia, segue a baixo print do erro e depois escrito

1676471017027.png


java.lang.IllegalArgumentException: 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.getActivityAsUser(PendingIntent.java:465)
at android.app.PendingIntent.getActivity(PendingIntent.java:451)
at android.app.PendingIntent.getActivity(PendingIntent.java:415)
at com.google.firebase.messaging.CommonNotificationBuilder.createContentIntent(com.google.firebase:firebase-messaging@@20.3.0:125)
at com.google.firebase.messaging.CommonNotificationBuilder.createNotificationInfo(com.google.firebase:firebase-messaging@@20.3.0:27)
at com.google.firebase.messaging.CommonNotificationBuilder.createNotificationInfo(com.google.firebase:firebase-messaging@@20.3.0:9)
at com.google.firebase.messaging.DisplayNotification.handleNotification(com.google.firebase:firebase-messaging@@20.3.0:27)
at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(com.google.firebase:firebase-messaging@@20.3.0:65)
at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(com.google.firebase:firebase-messaging@@20.3.0:44)
at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(com.google.firebase:firebase-messaging@@20.3.0:27)
at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(com.google.firebase:firebase-messaging@@20.3.0:17)
at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(com.google.firebase:firebase-messaging@@20.3.0:43)
at com.google.firebase.messaging.EnhancedIntentService$$Lambda$0.run(Unknown Source:6)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.6.0:2)
at java.lang.Thread.run(Thread.java:920)

Thanks.
 
Upvote 0

nicieri

Active Member
Licensed User
Longtime User
I have the same error since I changed target 30 to 33, the way I send notifications has always been the same. Even if the application is in the foreground, there is no problem, the error only occurs when the application is in the background.
 
Upvote 0

nicieri

Active Member
Licensed User
Longtime User
It's the same problem even with your tool, what changes are you referring to?

When changing from 30 to 33, should I change something on my server?

But even with the B4J tool it still does the same thing.
 
Upvote 0
Status
Not open for further replies.
Top