I develop an app with a functionality for sharing text. This is working fine except for WhatsApp. What should I do? Is there any specific API for that?
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
sendIntent.setPackage("com.whatsapp");
startActivity(sendIntent);
You can use the WhatsApp API Android: http://www.whatsapp.com/faq/en/android/28000012 iOS: http://www.whatsapp.com/faq/en/iphone/23559013
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
share.putExtra(Intent.EXTRA_TEXT, "Your text");
startActivity(Intent.createChooser(share, "Share using"));