Check the user’s device type

Identify if a user is using a mobile, tablet or desktop to view the app

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.

if (Fliplet.Env.is('native')) {
// code here will run on Android, iOS and Windows devices but not on web
}

if (Modernizr.native && Modernizr.mobile) {
  // Code here will run if an app is being viewed via a native app with a screen width smaller than 650px (eg a mobile).
}

if (Modernizr.ios) {
  // Code here will run if an app is being viewed via an ios device
}

if (Modernizr.android) {
  // Code here will run if an app is being viewed via an ios device
}

if (Modernizr.web) {
  // Code here will run if an app is being viewed via a web browser (can be done on mobile or desktop)
}

if (Modernizr.notch) {
  // Code here will run if an app is being viewed via a device that has a notch at the top
}