I'm trying to send an SMS with the android.telephony.SMSManager
.
When i send a SMS to someone around the country, it works. When i try so send an SMS to California for example, it doesnt work anymore.
Also, When i try to send a SMS to California, it returns a RESULT_ERROR_GENERIC_FAILURE
with errorcode 28.
Anyone knows what might be the issue?
Code used:
SmsManager sms = android.telephony.SmsManager.getDefault();
sms.sendTextMessage(getResources().getString(R.string.destination_address),
null, getResources().getString(R.string.forward), sentPI, deliveredPI);
I also added the SEND_SMS
permission in the manifest file.
Thanks in advance.
Wouter.
Try appending the country code:
SmsManager sms = android.telephony.SmsManager.getDefault();
sms.sendTextMessage("001" + getResources().getString(R.string.destination_address), null, getResources().getString(R.string.forward), sentPI, deliveredPI);
Already found the solution ! Looks like i had to add +1 to the Destination phone numer since i want to send a SMS from Europe to US.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With