Platform
const
Platform:object
Type declaration
isAndroidApp
isAndroidApp:
boolean
We’re running the Android app.
isDesktop
isDesktop:
boolean
The UI is in desktop mode.
isDesktopApp
isDesktopApp:
boolean
We’re running the electron-based desktop app.
isIosApp
isIosApp:
boolean
We’re running the iOS app.
isLinux
isLinux:
boolean
We’re on a Linux device.
isMacOS
isMacOS:
boolean
We’re on a macOS device, or a device that pretends to be one (like iPhones and iPads). Typically used to detect whether to use command-based hotkeys vs ctrl-based hotkeys.
isMobile
isMobile:
boolean
The UI is in mobile mode.
isMobileApp
isMobileApp:
boolean
We’re running the capacitor-js mobile app.
isPhone
isPhone:
boolean
We’re in a mobile app that has very limited screen space.
isSafari
isSafari:
boolean
We’re running in Safari. Typically used to provide workarounds for Safari bugs.
isTablet
isTablet:
boolean
We’re in a mobile app that has sufficiently large screen space.
isWin
isWin:
boolean
We’re on a Windows device.
resourcePathPrefix
resourcePathPrefix:
string
The path prefix for resolving local files on this platform. This returns:
file:///
on mobileapp://random-id/
on desktop (Replaces the old format ofapp://local/
)