nitro-device-info
nitro-device-info reads device, app, power and memory information in NitroUI apps. It is a Nitro 1.0 (nitro-core) module with Swift and Kotlin implementations, exposed to JavaScript as one DeviceInfo object with static methods.
Nothing it reads needs a runtime permission, a manifest permission, or an iOS privacy manifest reason.
import { DeviceInfo } from 'nitro-device-info'
const { modelName, systemName, systemVersion } = DeviceInfo.getDeviceDetails()
const { batteryLevel, batteryState, lowPowerMode } = DeviceInfo.getPowerState()
What it reads
| Area | Methods | Returns |
|---|---|---|
| Device and app | getDeviceDetails | 26 fields read once and cached: model, OS, app version, flags. |
| Power | getPowerState, a change listener | Battery level, battery state, Low Power Mode or Battery Saver. |
| Memory | getUsedMemory | Physical memory the app uses, in bytes. |
| Settings | getFontScale, getVendorId, isPasscodeSet, isLocationEnabled | Text size, a per-vendor or per-app ID, security and location. |
| Hardware | isHeadphonesConnected, getSystemFeatures, hasSystemFeature | Audio output route and the Android system features. |
| Web | getUserAgent | The platform web view's user agent. |
Every method is synchronous except isLocationEnabled and getUserAgent, which return a Promise.
Requirements
| Requirement | Version |
|---|---|
nitro-ui-renderer | 0.3.0 or later (peer dependency) |
nitro-core | 1.0.0-alpha.nightly.138.g43e09c161101 exactly |
| iOS | 16 or later |
Next steps
- Install the package and align
nitro-core. - Quick start: read details and observe the battery in a component.
- Platform differences: which fields differ or are absent per platform.
- API reference.