3

I am trying to open a mobile application from a browser using the construction:

try {
   window.location.href = 'yourApp';
} catch (error) {
   console.warn (error);
}

If the application doesn't find the browser, it shows the message "Failed to launch 'You app' because the scheme does not have a registered handler." But it doesn't fall in catch. How can I catch the event that such a scheme was not found?

  • There's a dirty workaround here: https://stackoverflow.com/a/1404662/5734311 (afaik, only a native app can detect whether or not a scheme handler exists) –  Mar 17 '21 at 14:05

0 Answers0