mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-04 14:54:24 +01:00
add ios banner on mobile safari
This commit is contained in:
committed by
Tony Giorgio
parent
812e861e10
commit
69f5935afd
21
src/utils/platform.ts
Normal file
21
src/utils/platform.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// https://stackoverflow.com/questions/9038625/detect-if-device-is-ios
|
||||
|
||||
import { Capacitor } from "@capacitor/core";
|
||||
|
||||
export function iosNotNative() {
|
||||
if (Capacitor.isNativePlatform() || Capacitor.getPlatform() === "ios") {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
[
|
||||
"iPad Simulator",
|
||||
"iPhone Simulator",
|
||||
"iPod Simulator",
|
||||
"iPad",
|
||||
"iPhone",
|
||||
"iPod"
|
||||
].includes(navigator.platform) ||
|
||||
// iPad on iOS 13 detection
|
||||
(navigator.userAgent.includes("Mac") && "ontouchend" in document)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user