If you are an Android App developer you can make use of implicit Intents to share a message via WhatsApp Application.
Intent sendToWhatsAppIntent = new Intent(); sendToWhatsAppIntent.setAction(Intent.ACTION_SEND); sendToWhatsAppIntent.putExtra(Intent.EXTRA_TEXT, "This message would be shared via WhatsApp."); sendToWhatsAppIntent.setType("text/plain"); startActivity(sendToWhatsAppIntent);
But if you are not a Android Java Native App developer and still want to integrate WhatsApp with your App or Website, it is now officially possible to share a message using HTML code to WhatsApp contacts, i.e. with your Website.
WhatsApp provides a custom URL (whatsapp://send?text=) to send message with WhatsApp :
Any website can now send text messages to WhatsApp chat application. One has to send a pre-filled text message to the custom URL scheme using a anchor tag. Opening whatsapp://send?text= followed by the text to send, will open WhatsApp. The user can now choose a contact, and pre-fill the input field with the specified text.
Example : How to achieve this :
<html> <head> <title>Send Message from Wesite to WhatsApp</title> </head> <body> <a href="whatsapp://send?text=Message!"> Send Message to a Contact Via WhatsApp.</a> </body> </html>
Hope you find this information useful : read more on WhatsApp official page : whatsapp.com/faq/en/android/28000012
Hashtags : #Android #WhatsApp #Integration
Code2care'smission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.