Skip to main content

How to cross post your Instagram stories to WhatsApp?

There are two ways to integrate with WhatsApp:

-Through a custom URL scheme
-Through Android's intent system

Custom URL Scheme:

WhatsApp provides a custom URL scheme to interact with WhatsApp:

If you have a website and want to open a WhatsApp chat with a pre-filled message, you can use our custom URL scheme to do so. Opening whatsapp://send?text= followed by the text to send, will open WhatsApp, allow the user to choose a contact, and pre-fill the input field with the specified text.

Here is an example of how to write this on your website:

Hello, world!

Android intent system:

Like most social apps on Android, WhatsApp listens to intents to share media and text. Simply create an intent to share text, for example, and WhatsApp will be displayed by the system picker:

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");

startActivity(sendIntent);

However, if you prefer to share directly to WhatsApp and bypass the system picker, you can do so by using setPackage in your intent:

sendIntent.setPackage("com.whatsapp");

This would simply be set right before you call startActivity(sendIntent);

Similarly you can use Android's intent system to send media through WhatsApp, once again, using setPackage to restrict the package to WhatsApp if you only want to send to WhatsApp.

To know more about Andoird Intent, check this page out.

Comments

Popular posts from this blog

Best Gaming Laptops You Can Buy Right Now

Gaming Laptops are no joke. They pack some serious performance under the hood that even some mid-range desktops cannot match. They’re often considered as huge, heavy and fat machines with red and blue paint all over their chassis, but that’s not the case at present. Over the past few years, manufacturers have introduced laptops packing more and more power in a thinner and lighter chassis. If you take a look at a gaming laptop from ten years ago and compare to anything from the present, I can guarantee that your jaw will drop and you’ll start wondering how technology has improved over the decade. Here are the top 10 performance grade laptops to make your selection from. 1. ASUS ROG G701VI Gaming Laptop  Unlocked Intel i7-7820HK processor 64GB of DDR4 RAM (yes, you read that right!) 1 TB NVMe SSD Overclockable GTX 1080 desktop class graphics card 17.3-inch 120Hz Full HD IPS panel with NVIDIA G-Sync 2. Alienware 17 R4 Intel i7-7820HK processor (overclocked up to 4.4 GHz) 32GB of DDR4 ...

Android 9.0 is Going to be Entirely Revamped

Android Material Design So even after having just 3gb of RAM, iPhone 10 is very more faster than few Android flagship smartphones out in the market and it's not only because of Apple's 11 Bionic chipset but it's also because of booting time, app opening animation, multitasking, closing animation and the RAM management. Yes, I want to say iOS handles everything just perfectly and smoothly. The reason we hate iOS / Android is because we cannot customize it and iPhones are very more expensive than Android smartphones. Yeah we have variety of Android smartphones out there which we consider better than iPhones and actually they are but one cannot deny the fact that iPhones are very more smoother than most of the Android smartphones but that's going to change with Android 9.0 P. Google is saying enough is enough they will dominate iOS operating system with Android 9.0 by doing major interface changes and by major they literally mean major the last huge change we ...

Beware of Windows 10 Activation Tech Support Scams

Windows 10’s growth is on a roll, the flagship operating system is currently running on over 300 million PCs and devices worldwide, since its launch last year. With the accelerated growth, comes new opportunities, both good and bad. The latest example of the bad is a Product Activation Scam that some users are starting to see on their installations. The Windows 10 Activation Pro Scam is quite convincing. Since Microsoft has been aggressively pushing for everyone to upgrade to Windows 10, it can easily fool non-techy users. Scams Pretending to Be Windows 10 Product Activation Recently, a follower on Twitter sent a tweet asking me to confirm if a recent message on their computer about activating Windows 10 was a scam. After reviewing the image below, it turned out her hunch was right. Scams such as this are intelligently designed and engineered to appear genuine. Users will notice the graphics use the same colors and themes associated with the real Windows 10 update branding. M...