Device details
getDeviceDetails() returns a DeviceDetails object. The native side builds it once, on the first call, and returns the cached value after that. This page covers the fields that are derived rather than read straight from an OS property.
Model name
| Platform | model | modelName |
|---|---|---|
| iOS | UIDevice.model (iPhone) | Marketing name from a table of known models (iPhone 16 Pro) |
| Android | Build.MODEL (Pixel 9) | Build.MODEL |
The iOS table covers the iPhone and iPad models that run iOS 16, the package's minimum, up to the iPhone 17 family and the iPad Pro (M5). A model released after the installed version of the package is not in the table: modelName falls back to model, and deviceYearClass is absent.
deviceId is the hardware identifier: the machine name on iOS (iPhone17,3, the simulated device's on a simulator), Build.DEVICE on Android.
Device type
| Value | iOS | Android |
|---|---|---|
phone | Phone interface idiom | Everything not matched below |
tablet | Pad interface idiom | Smallest screen width of 600 dp or more |
tv | TV interface idiom | Television UI mode, or the leanback feature |
desktop | An iPhone or iPad app running on a Mac | Desk UI mode, the PC feature (API 27+), or ChromeOS |
unknown | Other idioms, such as Apple Vision Pro | Watch UI mode |
Year class
deviceYearClass is the year a flagship with similar performance was released, for scaling features to the hardware.
- iOS: the model's release year from the same table as
modelName. Absent for models the table does not know. - Android: an estimate from physical memory, extending Facebook's year-class RAM table:
| Physical memory | Year |
|---|---|
| ≤ 768 MB | 2010 |
| ≤ 1 GB | 2011 |
| ≤ 1.5 GB | 2012 |
| ≤ 2 GB | 2013 |
| ≤ 3 GB | 2014 |
| ≤ 4 GB | 2016 |
| ≤ 6 GB | 2018 |
| ≤ 8 GB | 2020 |
| ≤ 12 GB | 2022 |
| more | 2024 |
Notch and Dynamic Island
- iOS: both come from the model table. A Dynamic Island does not count as a notch, so an iPhone 15 reports
hasNotch: false, hasDynamicIsland: true. - Android:
hasNotchis whether the display reports a cutout, on API 29 and later;falsebefore.hasDynamicIslandis alwaysfalse.
Emulator and root flags
isRooted is a heuristic that a determined user can defeat. Do not use it as a security boundary.
| Flag | iOS | Android |
|---|---|---|
isEmulator | Compiled for the simulator | Build fingerprint, hardware (goldfish, ranchu), model or product names that emulators use |
isRooted | Jailbreak files (Cydia, Sileo, /var/jb, ...) or write access outside the sandbox | test-keys build tags or su and Magisk paths |
isRooted is always false on the iOS simulator and on Android emulators, whose images look rooted.
Memory
totalMemory is the device's physical memory in bytes. On Android, maxMemory adds the Java heap limit (Runtime.maxMemory); it is absent on iOS. For the memory the app uses right now, call getUsedMemory().