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);