Using Phonegap to send SMS and show in Inbox

android, android-intent, cordova, phonegap-plugins

Solution

Ok well I got it working. Heres how I did it:

This is what my sendSMS looks like now and it seems to do what I want.

    private void sendSMS(String phoneNumber, String message) {
    SmsManager manager = SmsManager.getDefault();

    PendingIntent sentIntent = PendingIntent.getActivity(this.ctx, 0, new Intent(), 0);  
    manager.sendTextMessage(phoneNumber, null, message, sentIntent, null);


    ContentValues values = new ContentValues();
    values.put("address", phoneNumber);
    values.put("body", message);
    this.ctx.getContentResolver().insert(Uri.parse("content://sms/sent"), values);
}

Problem

So I found out how to send an SMS using phonegap programatically using https://github.com/phonegap/phonegap-plugins/tree/master/Android/SMSPlugin. However, when I send an SMS using this if I go to my inbox and few the conversation with the person I sent it too it does not show in there. Is there a way to add it to the conversation on there? Thanks.

Original source