Skip to main content

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​

AreaMethodsReturns
Device and appgetDeviceDetails26 fields read once and cached: model, OS, app version, flags.
PowergetPowerState, a change listenerBattery level, battery state, Low Power Mode or Battery Saver.
MemorygetUsedMemoryPhysical memory the app uses, in bytes.
SettingsgetFontScale, getVendorId, isPasscodeSet, isLocationEnabledText size, a per-vendor or per-app ID, security and location.
HardwareisHeadphonesConnected, getSystemFeatures, hasSystemFeatureAudio output route and the Android system features.
WebgetUserAgentThe platform web view's user agent.

Every method is synchronous except isLocationEnabled and getUserAgent, which return a Promise.

Requirements​

RequirementVersion
nitro-ui-renderer0.3.0 or later (peer dependency)
nitro-core1.0.0-alpha.nightly.138.g43e09c161101 exactly
iOS16 or later

Next steps​