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

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified #17

Open
Hossny37 opened this issue Sep 11, 2022 · 0 comments

Comments

@Hossny37
Copy link
Contributor

Hossny37 commented Sep 11, 2022

Hi,
The package works perfectly on Android versions before API 31, while mentioned exception is thrown for Android devices with API 31+, I managed to workaround the exception by changing the PendingIntent from FLAG_UPDATE_CURRENT To FLAG_MUTABLE
The exception with SmsSender
Before
val deliveredPendingIntent = PendingIntent.getBroadcast(
context,
UUID.randomUUID().hashCode(),
deliveredIntent,
PendingIntent.FLAG_UPDATE_CURRENT

After
val deliveredPendingIntent = PendingIntent.getBroadcast(
context,
UUID.randomUUID().hashCode(),
deliveredIntent,
PendingIntent.FLAG_IMMUTABLE

Best Regards

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

1 participant