×

Get Battery State

iOS 15 +

Notes

Gets whether the device's battery is unplugged, charging, or full.

Syntax

getBatteryState(state: <#Enumeration (BatteryStateType)#>)

Example

getBatteryState(state: unplugged)