title: How to open Amazon app from within my app?
body: <p>I'm trying to open Amazon app from within my app using following code:</p>
  
  <pre><code>if let url = URL(string: "amzn://"),
      UIApplication.shared.canOpenURL(url) {
      UIApplication.shared.open(url, options: [:], completionHandler: nil)
  } else if let url = URL(string: "https://www.amazon.com") {
      // fallback
      UIApplication.shared.open(url, options: [:], completionHandler: nil)
  }
  </code></pre>
  
  <p>This worked like a charm when I used it for the Youtube app. However, now with Amazon it just silently fails while it reports this error:</p>
  
  <blockquote>
    <p>2018-10-11 10:38:09.794370+0200 App[9739:3023026] -canOpenURL: failed for URL: "amzn://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"</p>
  </blockquote>
  
  <p>I've added url scheme to <code>LSApplicationQueriesSchemes</code> in <code>Info.plist</code>, but this changed nothing:</p>
  
  <pre><code>&lt;key&gt;LSApplicationQueriesSchemes&lt;/key&gt;
  &lt;array&gt;
      &lt;string&gt;amzn&lt;/string&gt;
  &lt;/array&gt;
  </code></pre>
  
  <p>What is even weirder, it does not even open the fallback URL - I would expect that if the <code>canOpen</code> fails, the second branch would work.</p>