React-native: iOS 14 default browser Linkin.canOpenURL issue

Created on 8 Oct 2020  路  3Comments  路  Source: facebook/react-native

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

On iOS 14 we have the ability to change the default browser. So, after I change it to Chrome when I call Linking.canOpenURL with any URL it returns false. But if I did not check and call Linking.openURL function it works and the link is opened in Chrome.

React Native version:

System:
OS: macOS 11.0
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 129.34 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
npm: 6.14.8 - ~/.nvm/versions/node/v12.18.3/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
Languages:
Java: 11.0.8 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: ^16.13.1 => 16.13.1
react-native: ^0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Change the default browser to Chrome
  2. Call Linking.canOpenURL() with any URL
  3. It will return false

Expected Results

When the default browser is changed Linking.canOpenURL() should return true

Needs iOS

Most helpful comment

add https & http to LSApplicationQueriesSchemes in Info.plist

All 3 comments

Did you check if this is an iOS bug? may be check ones.

add https & http to LSApplicationQueriesSchemes in Info.plist

add https & http to LSApplicationQueriesSchemes in Info.plist

This fixed the issue for us - thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

despairblue picture despairblue  路  3Comments

jlongster picture jlongster  路  3Comments

oney picture oney  路  3Comments

upbit picture upbit  路  3Comments

lazywei picture lazywei  路  3Comments