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)

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, 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.