Jump to content

How to change a URL for a button based on the users device

Recommended Posts

Site URL: https://www.rnatranslation.com

About to release an update for an app that includes uploading to iOS and Android

There's a button for downloading the app included in the screenshot provided that currently only links to iOS

I'd like to detect if the user is on iPad, iPhone or Mac and link to the app on iOS or if the user is on any platform outside of apple products to link to the app on Android

 

Screen Shot 2021-10-07 at 4.25.05 pm.png

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

On 10/7/2021 at 12:26 PM, RNATranslation said:

Site URL: https://www.rnatranslation.com

About to release an update for an app that includes uploading to iOS and Android

There's a button for downloading the app included in the screenshot provided that currently only links to iOS

I'd like to detect if the user is on iPad, iPhone or Mac and link to the app on iOS or if the user is on any platform outside of apple products to link to the app on Android

 

Screen Shot 2021-10-07 at 4.25.05 pm.png

I usually use this library to detect user-agent for device identifying

UAParser.js - Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data using JavaScript. Supports browser & node.js environment. Available as jQuery plugin & @types-ready for TypeScript library. (faisalman.github.io)

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date format)
💫 Animated Buttons (Referral URL)
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.