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

Sending MMS is failing on Android 12 with target API as 31 #187

Open
NickM-27 opened this issue Aug 18, 2021 · 4 comments
Open

Sending MMS is failing on Android 12 with target API as 31 #187

NickM-27 opened this issue Aug 18, 2021 · 4 comments

Comments

@NickM-27
Copy link

I updated my app to Android 12 and on an Android 12 device sending MMS fails

@ravibpatel
Copy link

@NickM-27 Does it work when you set the target API to 30?

@NickM-27
Copy link
Author

@ravibpatel i was able to fix it on my local build by overwriting the transaction class. It's due to MUTABLE not being specified in the pending intents flags

@BareumSW
Copy link

BareumSW commented Sep 2, 2021

@ravibpatel i was able to fix it on my local build by overwriting the transaction class. It's due to MUTABLE not being specified in the pending intents flags

Could I know more detailed?
In my case, sending MMS is failing on Android 11 with Google Pixel phone. No issue on Galaxy.

@ravibpatel
Copy link

ravibpatel commented Sep 2, 2021

@BareumSW You have to provide Mutability flag to all PendingIntent used in Transaction class as shown here.

Just change it and other PendingIntent you find in Transaction class as shown below.

Before

PendingIntent sentPI = PendingIntent.getBroadcast(
                        context, messageId, sentIntent, PendingIntent.FLAG_UPDATE_CURRENT);

After

PendingIntent sentPI = PendingIntent.getBroadcast(
                        context, messageId, sentIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);

It is required to provide mutability flag for PendingIntent if you are targeting Android 12 or above. It is mentioned in docs here. Prior to Android 12, a PendingIntent created without this flag was mutable by default.

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

3 participants