I am working on an Android app that is supposed to detect incoming SMSs and MMSs and do some follow-up operations. I was able to implement the SMS part without any problem but when it comes to MMS, the app is not detecting them.
I have the following lines in the Manifest file:
<receiver
android:name="com.library.MmsReceiver"
android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER"
android:priority="1" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
Also, I am asking for the following permissions for MMS:
<uses-permission android:name="android.permission.RECEIVE_MMS" />
<uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" />
The receiver class is declared in the following way:
class MmsReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
Log.d(MmsReceiver::class.java.simpleName, "onReceive: MMS RECEIVED")
}
}
When I receive an MMS message, I expect to see the above log in the console, but nothing is shown.
I looked over other posts on StackOverflow like Detecting MMS messages on Android, Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4) or How to read incoming MMS and SMS messages on Android but nothing helped.
Am I missing any configuration steps? Any help would be much appreciated.