Linking.openUrl with a telephone number throws an error #26554
Description
React Native version:
System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 37.91 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.4.0 - ~/.nvm/versions/node/v12.4.0/bin/node
Yarn: 1.12.1 - ~/.yarn/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v12.4.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 27, 28
Build Tools: 27.0.3, 28.0.0, 28.0.2, 28.0.3
System Images: android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.0 => 0.61.0
Steps To Reproduce
react-native init phonetest
- Change App.js to the following:
import {Button, Linking, SafeAreaView} from 'react-native';
const App = () => {
return (
<SafeAreaView>
<Button
onPress={() => {
Linking.openURL('tel:555-867-5309').catch(err =>
console.error('An error occurred', err),
);
}}
title="Call"
/>
</SafeAreaView>
);
};
export default App;
react-native run-ios
Describe what you expected to happen:
Dialog box asking whether to call the number or cancel