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

[bug] android 12 crash PendingIntent FLAG_MUTABLE flag #430

Open
gturedi opened this issue Feb 14, 2022 · 6 comments
Open

[bug] android 12 crash PendingIntent FLAG_MUTABLE flag #430

gturedi opened this issue Feb 14, 2022 · 6 comments

Comments

@gturedi
Copy link

gturedi commented Feb 14, 2022

if i set app target level to 31. iterable sdk crashed the app when showing notification on android 12 devices.
here logs:

Fatal Exception: java.lang.IllegalArgumentException
com.popcornvan.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.
android.app.PendingIntent.checkFlags (PendingIntent.java:382)
android.app.PendingIntent.getBroadcast (PendingIntent.java:660)
com.iterable.iterableapi.IterableNotificationHelper$IterableNotificationHelperImpl.createNotification (IterableNotificationHelper.java:195)
com.iterable.iterableapi.IterableNotificationHelper.createNotification (IterableNotificationHelper.java:37)
com.iterable.iterableapi.IterableFirebaseMessagingService.handleMessageReceived (IterableFirebaseMessagingService.java:62)
com.popcornvan.orderingapp.util.firebase.PopcornFirebaseMessagingService.onMessageReceived (PopcornFirebaseMessagingService.kt:14)
com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage (com.google.firebase:firebase-messaging@@22.0.0:13)

it is for pending intent, it should like below:

val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.getActivity(this, 0, activityIntent, PendingIntent.FLAG_IMMUTABLE)
} else {
PendingIntent.getActivity(this, 0, activityIntent, PendingIntent.FLAG_UPDATE_CURRENT)
}

@gturedi gturedi changed the title android 12 crash PendingIntent FLAG_MUTABLE flag [bug] android 12 crash PendingIntent FLAG_MUTABLE flag Feb 14, 2022
@masterwok
Copy link

Any update on this issue? This will prevent us from using Iterable on devices targeting API 31 and above.

@ryanrampage1
Copy link

ryanrampage1 commented Apr 26, 2022

Same issue here. Looking for a resolution timeline. Thank you!

@vbabenkoru
Copy link
Contributor

vbabenkoru commented Apr 26, 2022

Which version of the Iterable SDK are you using? If it's below 3.4.2, have you tried updating to the latest version?

@ryanrampage1
Copy link

Ah that was it, missed the minor releases on the release note page. You may consider rewording it as it is not super clear that there have been releases outside of what is listed there. Would also argue that this is a major release and should have been documented there regardless as it was enabling compatibility for 31+.

https://support.iterable.com/hc/en-us/articles/360027543332-Release-Notes-Iterable-s-Android-SDK-

@rkushch-asp
Copy link

Facing the same issue, it's not possible to update android SDK to 31 due to Iterable dependency

@ryanrampage1
Copy link

@rkushch-asp which version are you using? I ended up getting it working with
implementation 'com.iterable:iterableapi:3.4.5'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants