tkporter/react-native-sms

Message not pre filling in android device

anoopmm opened this issue · 4 comments

I haven't had the opportunity to reproduce this, is it happening with a specific device/Android version? It seems pretty undesirable to not have the message body be shown (even if pressing "send" still sends the pre-filled message)

Confirmed on my emulator running Nexus 5X API 25, 7.1.1 (Google Play), x86.

Basically the same as #18 except pressing SEND doesn't do anything, there is no "hidden" text in the input box or anything.

@tkporter: I have this problem also. Android 7.1.1 running on a Nexus 6. Using the standard Android "Messages" app. The input field for message text is empty with a placeholder ("Type an SMS message"). The send button is disabled.

It turns out that the solution to this is to not only send the body like this:
sendIntent.putExtra("sms_body", body);
but also like this:
sendIntent.putExtra(sendIntent.EXTRA_TEXT, body);
Ref. https://developer.android.com/training/sharing/send.html

I have made a pull request with this change: #43

Closing this after #43 and will republish under version 1.5.2 later today. Feel free to reopen if this issue continues!