This library allows to know more information about the device platform
import { getPlatform, isWebApp, isMobileApp, isIOSApp, isAndroidApp, isFlagshipApp } from 'cozy-device-helper'
To know the platform:
isFlagshipApp()
: returnboolean
if inside the flagship app.getPlatform()
: returnios
,android
orweb
isWebApp()
: returnboolean
isMobileApp()
: returnboolean
. True if its a cordova App. False for others.isIOSApp()
: returnboolean
. True if its a cordova App on iOS.isAndroidApp()
: returnboolean
. True if its a cordova App on Android.isAndroid()
: returnboolean
(check if the user is on an android smartphone (native & browser))isOS()
: returnboolean
(check if the user is on an iOS smartphone (native & browser))isMobile()
: returnboolean
(check if the user is on an android or iOS smartphone (native & browser))
import { getDeviceName } from 'cozy-device-helper'
To know device name getDeviceName()
.
import { hasDevicePlugin, hasInAppBrowserPlugin, hasSafariPlugin, checkApp, startApp } from 'cozy-device-helper'
hasDevicePlugin
: returnboolean
hasInAppBrowserPlugin
: returnboolean
hasSafariPlugin
: return a promise which resolve by aboolean
checkApp
: return apromise
that resolves with informations about the application (if installed) or false (if not installed)startApp
: Start an Application. Return apromise
- False if the application was not able to be started