Mobile App Conditional Download
April 17th, 2021 / By Andrew Currie

April 17th, 2021 / By Andrew Currie
So you’re a mover and shaker, you have both iOS and Android applications for your business, bravo! Wouldn’t it be nice to detect which type of device is accessing your website and provide the appropriate download link for your mobile app, instead of always displaying both links? This can be especially useful when working with the portrait view on mobile and other smaller viewports.
Using the Mobile Detect library for PHP, you can set up dynamic download links that accommodate the devices accessing your site. Follow the instructions below to set up a working mobile detection demo with conditional mobile app download links:
If you’ve set it up correctly, the demo web page should look like the screenshot below and the button will take you to the download page for the Binance mobile app. If you’re visiting the page using an iOS device, the button will take you to the Apple App Store link. If you visit the page using an Android-based device, the button will take you to the Google Play Store.