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.
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 http://
or https://
, I'd like the download link to be appname://domain.com/folder/filename.pdf
. 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.
How would I go about:
- detecting if the user is on a mobile device, and
- changing the URI scheme if they are a mobile user?
The concept I am trying to accomplish is described here in the "Native App" example: http://www.mobiloitte.com/blog/deep-linking-101
https://example.com/folder
download links, instead of using a custom URI scheme. This should be possible on both iOS and Android. – Abrego