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

Now you can whisper to Alexa

Amazon’s Alexa can now listen and respond to whispers, and she will whisper back. Now first, this might set off another wave of anxiety for privacy advocates. Your virtual assistant is not only spying on you and potentially recording or storing your conversations, now she can do even if you tried to keep your voice down. Amazon’s team just made that sensitive microphone function even more acutely. Video demonstrating Alexa whisper: So, why do we need to whisper in the first place? Will it come handy in anyway? Yes. If you whisper, “Echo, play a lullaby,” for the infant who’s almost asleep in your arms, Echo will whisper back, “Here’s a station for lullabies from your Amazon Music library,” instead of screaming at  full startling volume. What's more? Whisper is not the only important feature that will come to Amazon Echo devices this year, we also have bunch of new ones. Guard : Guard will let you say, “Alexa, I’m leaving,” and the device will automatically acti...

Microsoft Edge Arrived for Android and iOS

Last week, Microsoft made a pretty surprising announcement. The company revealed that it would bring its Edge browser to iOS and Android, making it easier for existing Edge users (and possible converts) to take their browsing history, bookmarks, and other data with them. Now the beta app is available for download from the Play Store for some countries. But others can download the APK to give it a try. So how is the browser itself? Well, it feels like a mix of desktop Edge and mobile Chrome. The start page has your frequently-visited pages with a search bar, along with stories from MSN below that (which you can turn off). The UI is split into an address bar and Reading List/History/Bookmarks button at the top, and everything else at the bottom. Both bars pull away as you scroll down the page, and re-appear when you swipe up. Familiar Microsoft Edge features like the Hub allow users to organize the web in a way that cuts through the clutter, making it easier to find, view and manage thei...

How to build new Metro UI apps with Visual Studio?

The new Modern UI apps are pretty fascinating , aren't they? Building these apps with older versions of Visual Studio like the 2010 edition is pretty cumbersome. While the newer 2015 and 2017 editions of Visual Studio come with Expression Blend, which helps to build those. But what if you want to build them with yuor old IDE itself, in the VS 2010? Yes, you can.  You need the Bunifu Framework. It's availabel as a trial for 7 days or you can buy rhe oaid version. let me show you how it works You can download it from its official site . After installing the app, provide your email and your trial period is good to go for 7 days. Then open Visual Studio. Under toolbox add a new tab with whatever name you would like to give. Then right click on it and hit Choose items. In the dialogue box shown, choose the .dll file by clicking the Browse button, Finally click open and go further. After all the controls being added you can use them to create your Modern UI apps hands down. You can j...