Skip to main content

Device Info

Get device model, system, screen, battery, network, and other basic info. All synchronous — no await needed.

Basic Info

this.version  = Device.systemVersion()  // "17.5"
this.name = Device.name() // "iPhone 15 Pro"
this.model = Device.model() // "iPhone"
this.language = Device.language() // "zh"
this.darkMode = Device.isdarkmode() // true / false

Screen

const s = Device.screen()
console.log(s)
// { scale: 3, width: 393, height: 852 }
FieldDescription
scalePixel density multiplier (2x / 3x)
width / heightLogical screen width / height in points

Battery

const b = Device.battery()
console.log(b)
// { "state": "unplugged", "level": 0.75 }
stateMeaning
unknownUnknown
chargingCharging
fullFully charged
unpluggedNot charging

level is a 0–1 decimal. Multiply by 100 for the percentage.

Network Status

const n = Device.network()
console.log(n)
// {
// "wifi": true,
// "cellular": false,
// "online": true,
// "vpn": false
// }
FieldDescription
wifiConnected to Wi-Fi
cellularUsing cellular
onlineOnline (either of the above)
vpnOn VPN

Connectivity (Bluetooth / Hotspot)

const c = Device.connectivity()
console.log(c)
// { "bluetooth": "on", "hotspot": false }
FieldValue / Type
bluetooth"on" / "off" / "unsupported" / "unauthorized" / "resetting" / "unknown"
hotspottrue / false
Bluetooth permission

Reading Bluetooth status requires the app to have the Bluetooth permission configured. iOS prompts on first use. If denied, returns "unauthorized".

Example: A "Network Status" Icon

const n = Device.network()
this.netIcon = n.wifi ? "wifi" : (n.cellular ? "antenna.radiowaves.left.and.right" : "wifi.slash")

Put {netIcon} in an icon component to auto-switch icons based on network status.