mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-16 08:08:56 -05:00
28 lines
611 B
TypeScript
28 lines
611 B
TypeScript
function isAndroid(): boolean {
|
|
return (
|
|
typeof navigator !== 'undefined' && /android/i.test(navigator.userAgent)
|
|
);
|
|
}
|
|
|
|
function isSmallIOS(): boolean {
|
|
return (
|
|
typeof navigator !== 'undefined' && /iPhone|iPod/.test(navigator.userAgent)
|
|
);
|
|
}
|
|
|
|
function isLargeIOS(): boolean {
|
|
return (
|
|
typeof navigator !== 'undefined' &&
|
|
(/iPad/.test(navigator.userAgent) ||
|
|
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1))
|
|
);
|
|
}
|
|
|
|
function isIOS(): boolean {
|
|
return isSmallIOS() || isLargeIOS();
|
|
}
|
|
|
|
export function isMobile(): boolean {
|
|
return isAndroid() || isIOS();
|
|
}
|