This tutorial explains how to share particular message to whatsapp application in react native application. Sharing a content in whataspp application is very easy and simple. Just you need to import Linking class from the react-native package.
Follow the below steps to share text content in whatsapp application :
1. import Linking class from the react-native package.
2. Call the below function, in order to share content in whatsapp application.
Lets try the below function in your react native application, that helps to share content in whatsapp application.
This is all about Sharing to WhatsApp from a react native application.Thank you for reading this article, and if you have any problem, have a another better useful solution about this article, please write message in the comment section.
Follow the below steps to share text content in whatsapp application :
1. import Linking class from the react-native package.
import { Linking } from "react-native";
2. Call the below function, in order to share content in whatsapp application.
shareToWhatsApp = (text) => { Linking.openURL(`whatsapp://send?text=${text}`); }
Lets try the below function in your react native application, that helps to share content in whatsapp application.
Share a message
Lets use below function in react native to share message in whatsapp application.
shareToWhatsApp = (text) => { Linking.openURL(`whatsapp://send?text=${text}`); }
Share a message with specific contact
Lets use below function in react native to share message to particular user in whatsapp application.
shareToWhatsAppWithContact = (text, phoneNumber) => { Linking.openURL(`whatsapp://send?text=${text}&phone=${phoneNumber}`); }
This is all about Sharing to WhatsApp from a react native application.Thank you for reading this article, and if you have any problem, have a another better useful solution about this article, please write message in the comment section.
can we send image (bse64) with text?
ReplyDelete