I have an app that listening to the incoming text msg.  When it comes,
the app replies a msg to the sender.  On emulator, it seems working
fine as designed.  After deployed on phone, the incoming msg comes,
the app still can be notified.  So the app sends a reply to the
sender.  The problem is the reply msg is never received.

This is the line that does the send:

SmsManager.getDefault().sendTextMessage(incomingPhoneNumber, null,
application.getMessage(), null, null);


According to the document, I can send with two intents as the last two
params, so I could be assured that the msg is actually sent and/
delivered.

So I added following:

Intent sentIntent = new Intent(context, SmsResultReceiver.class);
sentIntent.putExtra("INCOMING_PHONE_NUMBER", incomingPhoneNumber);
sentIntent.setAction("SMS_SENT");

Intent deliverIntent = new Intent(context, SmsResultReceiver.class);
deliverIntent.putExtra("INCOMING_PHONE_NUMBER", incomingPhoneNumber);
deliverIntent.setAction("SMS_DELIVER");

PendingIntent sentPendingIntent =
PendingIntent.getBroadcast(application.getApplicationContext(), 0,
sentIntent, PendingIntent.FLAG_CANCEL_CURRENT);

PendingIntent deliverPendingIntent =
PendingIntent.getBroadcast(application.getApplicationContext(), 0,
deliverIntent, PendingIntent.FLAG_CANCEL_CURRENT);

SmsManager.getDefault().sendTextMessage(incomingPhoneNumber, null,
application.getMessage(), sentPendingIntent, deliverPendingIntent);

In SmsResultReceiver, I received the notification the sms is sent; but
I never received the notification that sms is delivered.

In the phone that I sent the text msg never receives the reply msg
from android.

Is therer something I simply overlooked?  I have the following
permissions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to