-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile): add device detection and screen orientation locking
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
import { Device } from "@capacitor/device" | ||
|
||
export function checkMobile(): boolean { | ||
return window.matchMedia("screen and (max-width: 800px)").matches | ||
} | ||
|
||
export async function isAndroidOriOS(): Promise<boolean> { | ||
const info = await Device.getInfo() | ||
return info.platform === "ios" || info.platform === "android" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters