Cozy Device Helper¶
This library allows to know more information about the device platform
API¶
Platforms¶
import { getPlatform, isWebApp, isMobileApp, isIOSApp, isAndroidApp } from 'cozy-device-helper'
To know the platform:
getPlatform(): returnios,androidorwebisWebApp(): returnbooleanisMobileApp(): returnbooleanisIOSApp(): returnbooleanisAndroidApp(): returnbooleanisAndroid(): 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))
Device Name¶
import { getDeviceName } from 'cozy-device-helper'
To know device name getDeviceName().
Cordova Plugins¶
import { hasDevicePlugin, hasInAppBrowserPlugin, hasSafariPlugin, checkApp, startApp } from 'cozy-device-helper'
hasDevicePlugin: returnbooleanhasInAppBrowserPlugin: returnbooleanhasSafariPlugin: return a promise which resolve by abooleancheckApp: return apromisethat 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