title: How can I set an "mobile deep link" to downloadable file from woocommerce?
body: <p>I have woocommerce setup up on a wordpress site for downloading PDF files.  After a user goes through the checkout process and is ready to download the file, I'd like to check to see if they are on a mobile device or not.  If the user is not on a mobile device, the download link would just be normal.</p>
  
  <p>If the user is on a mobile device, I'd like to set the download link to be an "app deep link" using a custom URI scheme (from an existing vendor).  For example, instead of the download link referencing <code>http://</code> or <code>https://</code>, I'd like the download link to be <code>appname://domain.com/folder/filename.pdf</code>.  This way, the PDF would automatically open in my app when they clicked on the link.  The app vendor already support the custom URI schema, so I am just looking for "how" to set the link dynamically in WordPress/Woocommerce.</p>
  
  <p>How would I go about:</p>
  
  <ol>
  <li>detecting if the user is on a mobile device, and</li>
  <li>changing the URI scheme if they are a mobile user?</li>
  </ol>
  
  <p>The concept I am trying to accomplish is described here in the "Native App" example: <a href="http://www.mobiloitte.com/blog/deep-linking-101" rel="noreferrer">http://www.mobiloitte.com/blog/deep-linking-101</a></p>
  
  <p>and here: <a href="https://en.wikipedia.org/wiki/Mobile_deep_linking" rel="noreferrer">https://en.wikipedia.org/wiki/Mobile_deep_linking</a></p>