android-smsmms
android-smsmms copied to clipboard
Sending MMS is failing on Android 12 with target API as 31
I updated my app to Android 12 and on an Android 12 device sending MMS fails
@NickM-27 Does it work when you set the target API to 30?
@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
@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.
@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.