How to recognize the OS of a mobile device?

Hi guys,   We have a mobile application running on Mx. I want to trigger OS specific functions, and therefore I need to know whether an user is iOS user or an Android user. How could I determine in Mx which type OS the mobile user has?   thnx
3 answers

You could retrieve this information in a Java action using ISession.getUserAgent().

This results in a string looking like this: User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko


Hi Enzo,


I think there are different ways to do this (custom java action / JavaScript / JQuery). I have not tried it or read it fully but just found this which I thought might be helpful to you

Hope this helps!



Mohammed Siddiqui 



You can use JavaScript window.matchMedia() method to detect a mobile device based on the CSS media query.

if (window.matchMedia("(max-width: 767px)").matches)
  // The viewport is less than 768 pixels wide
  document.write("This is a mobile device.");

You may also use .

const isMobile =;

Another approach would be a responsive media query. You could presume that a mobile phone has a screen size greater than x and less than y. For example:

@media only screen and (min-width: 320px) and (max-width: 600px) {}