device ‐ Current Device Information - cobocombo/Scriptit-Core GitHub Wiki
Module that provides information about the current device.
Properties
- batteryLevel: The latest stored battery level.
- batteryState: The latest stored battery state. Returns one of the following options: charging, full, unplugged, or unknown.
- currentOrientation: Current orientation of the device. Returns either landscape or portrait.
- interfaceStyle: Current iOS UI style. Returns either light or dark.
- isIpad: Flag that returns if the device is an iPad or not.
- isIphone: Flag that returns if the device is an iPhone or not.
- isLandscape: Flag that returns if the device is currently in landscape orientation or not.
- isPortrait: Flag that returns if the device is currently in portrait orientation or not.
- screenHeight: The screen height value in points value. Height will always be confined to the portrait orientation.
- screenWidth: The screen width value in points value. Width will always be confined to the portrait orientation.
- systemName: The current name of the operating system.
- systemVersion: The current version of operating system.
Usage
console.log(device.batteryLevel)
console.log(device.batteryState)
console.log(device.currentOrientation)
console.log(device.interfaceStyle)
console.log(device.isIpad)
console.log(device.isIphone)
console.log(device.isLandscape)
console.log(device.isPortrait)
console.log(device.screenHeight)
console.log(device.screenWidth)
console.log(device.systemName)
console.log(device.systemVersion)