Home > Blockchain >  How to send whatsapp message from another android app? (see detail though)
How to send whatsapp message from another android app? (see detail though)

Time:02-03

I have an app and we want the following

  • Type message in this app(not whatsapp)
  • Our app knows the user from the contact list
  • Click send
  • Message should be sent to the user without whatsapp asking for the user except maybe in special case of multiple phone numbers maybe?
  • Message sent should show up in whatsapp history as part of the chat with the targetted user

Is this even possible? The post I read makes the user go into whatsapp and select the user to send the message to. Is that unavoidable?

CodePudding user response:

correct. the user has to go into whatsapp and select the user to send the message to. that is unavoidable.

https://faq.whatsapp.com/android/im-an-android-developer-how-can-i-integrate-whatsapp-with-my-app

If you want to pre-fill a message you can do so by using a custom URL scheme whatsapp://send?text=followed by the text to send or by setting an extra on the send intent sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send."); Both will allow the user to choose a contact, and pre-fill the input field with the specified text.

  •  Tags:  
  • Related