Device

device.name()

Syntax

var name = device.name();

Return value

A String containing the device’s name

device.systemName()

Syntax

var systemName = device.systemName();

Return value

A String containing the device’s system name (e.g. iOS)

device.systemVersion()

Syntax

var version = device.systemVersion();

Return value

A Number representing the device’s system version (e.g. 13.5)

device.model()

Syntax

var model = device.model();

Return value

A String containing the device’s model (e.g. iPhone)

device.identifierForVendor()

Syntax

var id = device.identifierForVendor();

Return value

A String containing the device’s vendor identifier

device.orientation()

Syntax

var orientation = device.orientation();

Return value

A Number representing the device’s orientation (1 is portrait, etc.)

device.isPortrait()

Syntax

var portrait = device.isPortrait();

Return value

A Boolean representing whether the device is in portrait orientation or not

device.isLandscape()

Syntax

var landscape = device.isLandscape();

Return value

A Boolean representing whether the device is in landscape orientation or not

device.isLocked()

Syntax

var locked = device.isLocked();

Return value

A Boolean representing whether the device is locked or not

device.isScreenOn()

Syntax

var screenOn = device.isScreenOn();

Return value

A Boolean representing whether the device’s screen is on or not

device.batteryLevel()

Syntax

var batteryLevel = device.batteryLevel();

Return value

A Number between 0 and 100 representing the device’s battery level

device.batteryState()

Syntax

var batteryState = device.batteryState();

Return value

A Number representing the device’s battery charging state (1 is unplugged, etc.)

device.shutdown()

Syntax

device.shutdown();

device.reboot()

Syntax

device.reboot();

device.respring()

Syntax

device.respring();

device.safemode()

Syntax

device.safemode();

device.lock()

Syntax

device.lock();