How does Onsen UI detects the device ?
MaxenceCornet last edited by MaxenceCornet
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 !
@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
MaxenceCornet last edited by
Thank you for your answer !