d
Amit DhamuSoftware Engineer
 

iOS and Android Detection

1 minute read 00000 views
/* iPad */
if (navigator.platform.indexOf('iPad') != -1) {
  // Using iPad
} else {
  // Not using iPad
}

/* iPhone */
if (navigator.platform.indexOf('iPhone') != -1) {
  // Using iPhone
} else {
  // Not using iPhone
}

/* iPod */
if (navigator.platform.indexOf('iPod') != -1) {
  // Using iPod
} else {
  // Not using iPod
}

/* Android */
if (navigator.platform.indexOf('android') != -1) {
  // Using Android
} else {
  // Not using Android
}