- Let's start by opening App.js and adding the imports we'll be using:
import React from 'react';import { StyleSheet, Text, View, TouchableOpacity, Platform } from 'react-native';import { Linking } from 'react-native';import { WebBrowser } from 'expo';
- Next, let's add both an App component and a state object. In this app, the state object will house all of the links that we'll be using in this recipe in an array called links. Notice how the url property in each links object has a protocol attached to it (tel, mailto, sms, and so on). These protocols are used by the device to properly handle each link:
export default class App extends React.Component { state = { links: [ { title: 'Call Support', url: 'tel:+12025550170', ...