Android
const isInAndroid = () => {
var u = navigator.userAgent
return u.indexOf('Android') > -1 || u.indexOf('Linux') > -1
}
IOS
const isInIOS = () => {
var u = navigator.userAgent
return !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
}