klinker41 / android-smsmms

Library for easily sending SMS and MMS for Android devices
673 stars 247 forks source link

Receive MMS Fail, Need change 3 lines of code to make it working #171

Closed zakhao closed 4 years ago

zakhao commented 4 years ago

Under some situations, Unable to receive MMS in some cases, need to modify 3 lines of code in the following file. File: android-smsmms/library/src/main/java/com/android/mms/transaction/DownloadManager.java

Need delete these 3 lines of code: // TransactionService can keep uri and location in memory while SmsManager download Mms. if (!isNotificationExist(context, location)) { return; }

Then receiving MMS is working perfectly.

zakhao commented 4 years ago

I'm using Android 7.0

klinker24 commented 4 years ago

Can you give me a bit more information on what the situation is, what device you are using, and just a bit more info around this, in general?

zakhao commented 4 years ago

In the sample code. When I do the testing, I find out when receive MMS, It will trigger MMsReceiver. But Never go to MmsReceivedReceiverImpl. I use debug at PushReceiver(in Library) to follow the code. I realize in DownloadManager, isNotificationExist will always return False. Delete it will make MMS working. After delete it, Library is working for my own project as well. Mobile is Android 7.0, it has Dual SIM. Not sure if it is for this reason

klinker24 commented 4 years ago

What type of device do you have?

Removing that is just going to remove the check for whether or not the notification that the MMS is available is saved to the MMS database. I don't think it will really hurt anything to remove it, just seems weird that your device doesn't have that notification in the database.

zakhao commented 4 years ago

I'm using "MIUI 10" (popular customized system in China, Millions of people are using) Android system. Mobile device is XiaoMi 9. With out notification check, The MMS still saved to MMS database. I also checked the code from QKSMS(https://github.com/moezbhatti/qksms). He is using your library. But modified some of them. It's working in my system. The notification check is return True. You may check the difference of the code from him and yours. Hope that can help you.

klinker24 commented 4 years ago

The functions are the exact same between my app and that one, there is no difference at all, since your aren't on kitkat.

Anyways, I don't see any harm in removing it. Removing that check isn't going to cause additional failures. I released a new version of the library yesterday.