How to do it...

  1. 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';
  1. 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', ...

Get React Native Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.