IOS url type doesn't work on React Native when using action-native-safari-view

I have set up a url for my application in Xcode. For the purposes of the question, I've removed the actual package IDs.

enter image description here

My Bundle project id is com.domain.foo .

I have a simple web page that simply redirects in three ways:

window.onload = function() {
  window.location.href="myschemereceiver://foo=bar";
  window.location="myschemereceiver://foo=bar";
  window.open("myschemereceiver", "_self");
}

      

However, when I load the embedded Safari View url using this package, it does not redirect my application.

When I load the page in Safari, it redirects my application.

Edit

Whenever I try to redirect a URL type that doesn't exist, Safari throws an error (which is expected). When changing it to a valid type, Safari does nothing, just displays a white screen.

+3


source to share


1 answer


Safari View Controller does not allow you to open the app by clicking the URL inside it. To work around this problem, you need to use a WebView.

However, your application will not launch if the WebView is called directly with myschemereceiver://foo=bar

(since entering the URL directly in the safari address bar does not launch the application). When the user clicks inside the Safari view controller, you need to launch a WebView with the website and the user needs to click on another link, or you will need to use javascript from that website to open the app from there.



More information on app and browser support for universal links can be found here .

+2


source







All Articles