Recognize mobile operating system

Hi,
How can I differ between ios and android?
Thanks!

Hey Dafna
In js we can use navigator to detect the device
but i am not sure wix code support it
here is the stackoveflow answer
https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system

we can build a custom code solution using tracking and analytic section
but it requires a premium site to do so.

I don’t think that you can actually define what sort of operating system your user is using like either iOS or Android, you can only define what the user is using device wise like desktop, tablet or mobile etc and code for that option by using Wix Window API and the formFactor function and writing code that only works on one of those three.

I think that what you are trying to achieve something like what is stated on this previous Stack post.
https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system

It’s trivial to fetch the user agent from inside an iframe and postMessage it back to the Wix page. Whether this would be janky as hell rather depends on what differences you had in mind.

Actually I need to know if it’s ios or android, & if it’s ios, I need to know the vesrion…

@dafna-kotzer I used an iframe to get the OS and post it to the page But in the previous discussion someone (I think it was David) has mentioned that you can install the useragent npm for that.

@jonatandor35 will check. Thanks a lot!

Hi @dafna-kotzer , how can I reach you privately? I’d have some services I need help with. thanks!

dafna@wonderwix.net

Can someone elaborate on whether this worked. I need to do exactly the same thing where, based on iOS vs Android, I need to redirect to the appropriate app store.