URI encode phone number before sending SMS to it
This commit is contained in:
parent
1a55ec4665
commit
3d12a8da46
|
@ -229,7 +229,7 @@ fun Context.sendSMSToContacts(contacts: ArrayList<Contact>) {
|
||||||
val number = it.phoneNumbers.firstOrNull { it.type == ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE }
|
val number = it.phoneNumbers.firstOrNull { it.type == ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE }
|
||||||
?: it.phoneNumbers.firstOrNull()
|
?: it.phoneNumbers.firstOrNull()
|
||||||
if (number != null) {
|
if (number != null) {
|
||||||
numbers.append("${number.value};")
|
numbers.append("${Uri.encode(number.value)};")
|
||||||
}
|
}
|
||||||
|
|
||||||
val uriString = "smsto:${numbers.toString().trimEnd(';')}"
|
val uriString = "smsto:${numbers.toString().trimEnd(';')}"
|
||||||
|
|
Loading…
Reference in New Issue