Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

How does Onsen UI detects the device ?



  • Last night, after the blog post on Meteor + onsen UI 2, I started building an app for fun.

    I was wondering what CLI command I had to call in order to switch from material to IOS design. But I was amazed when I saw it automatically changed when, In chrome debugger, I switched between Iphone 5 simulator or nexus/samsung.

    So, Onsen is not using navigator.device properties no ? How does it detects if it’s running on IOS or Android ?

    So far, I’m having a blast with onsen 2 !


  • Onsen UI

    @MaxenceCornet I’m glad you like it :smile:

    Onsen UI relies on Cordova Plugin Device if present (device.platform). If not, it checks navigator.userAgent. And all of this can be faked with ons.platform.select('android') :sweat_smile:



  • Thank you for your answer !