React Native component to open WhatsApp app with a preset message to a preset phone number
Local clone:
git clone https://github.com/ategani/whatsapp-component.git
Installing all the dependencies
cd whatsapp-component
yarn install
Starting a local dev server for the app
expo start
import React from 'react';
import {
Platform,
SafeAreaView,
StyleSheet,
View
} from 'react-native';
import WhatsApp from '../components/WhatsApp';
const HomeScreen = () => {
return (
<SafeAreaView style={styles.container}>
<View>
<WhatsApp />
</View>
</SafeAreaView>
)
}
Go to whatsapp-component/src/components/WhatsApp.js and set the value of phoneWithCountryCode variable with a valid phone number
let phoneWithCountryCode = ''; //5511912345678
React Native Whatsapp Component is open source software licensed as MIT.