Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

iOSDevice.BatteryLevel

The battery charge level for the device.

Component Version macOS Windows Linux Server iOS SDK
iOSDevice 7.2 ❌ No ❌ No ❌ No ❌ No ✅ Yes
MBS( "iOSDevice.BatteryLevel" )

Parameters

none

Result

Returns value or error.

Description

The battery charge level for the device.
Battery level ranges from 0.0 (fully discharged) to 1.0 (100% charged). Before accessing this property, ensure that battery monitoring is enabled.
If battery monitoring is not enabled, battery state is Unknown and the value of this property is –1.0.

Examples

Show battery level:

Show Custom Dialog [ "Battery Level" ; MBS( "iOSDevice.BatteryLevel" ) ]

See also

This function is free to use.

Created 18th March 2017, last changed 25th November 2017


iOSApp.SetWillResignActiveScript - iOSDevice.BatteryState

💬 Ask a question or report a problem