Fliplet automatically detects the type of device being used to view an app. Fliplet uses Modernizr (v3.5.0) to help developers target users with specific device capabilities and contexts.
x
23
23
1
if (Fliplet.Env.is('native')) {
2
// code here will run on Android, iOS and Windows devices but not on web
3
}
4
5
if (Modernizr.native && Modernizr.mobile) {
6
// Code here will run if an app is being viewed via a native app with a screen width smaller than 650px (eg a mobile).
7
}
8
9
if (Modernizr.ios) {
10
// Code here will run if an app is being viewed via an ios device
11
}
12
13
if (Modernizr.android) {
14
// Code here will run if an app is being viewed via an ios device
15
}
16
17
if (Modernizr.web) {
18
// Code here will run if an app is being viewed via a web browser (can be done on mobile or desktop)
19
}
20
21
if (Modernizr.notch) {
22
// Code here will run if an app is being viewed via a device that has a notch at the top
23
}
Was this article helpful?
YesNo