'Android SMS Activity is not handling body / message data
My app is supposed to send a sms with data as content, that is generated by my app. On all devices that i have for testing is it working like expacted. The SMS client program is showing up, the correct number is set as receiver and the content of the SMS is what I want.
BUT on some phones is that not working correct. Some other people were testing my app as well and during this test we noticed, that some smartphone are opening the SMS client and also open the right "chat" with the correct receiver, but the SMS content is empty. One Phone where this is happening is the CAT S62 Pro.
Because on all my test devices it worked like wanted, I tried to recreate this misbehavior by not using the default SMS client. By using the "Schlichter SMS Messenger" (https://play.google.com/store/apps/details?id=com.simplemobiletools.smsmessenger&gl=DE) I was able to have the same misbehavior. But I think that this happens, because this app is not handling the SMS body that was send with the Intent.
Here is my part of code for calling the SMS client:
val sendIntent = Intent(Intent.ACTION_SENDTO)
sendIntent.data = Uri.parse("smsto:${phoneNumber}")
sendIntent.putExtra("sms_body", message)
if (sendIntent.resolveActivity(packageManager) != null) {
startActivity(sendIntent)
} else {
Toast.makeText(applicationContext, "No SMS system application found.", Toast.LENGTH_LONG).show()
}
Does anyone know why some phones default SMS clients, like the one from the CAT S62 Pro, is not handling the SMS body correct? Am I doing something wrong? Is there a fix or workaround for? Or do I have to live with the situation, that some default SMS clients are not always able to handle the SMS body correct?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
