For AI agents: the complete documentation index is available at /react-native-nitro-device-info/llms.txt, the full documentation bundle is available at /react-native-nitro-device-info/llms-full.txt, and this page is available as Markdown at /react-native-nitro-device-info/guide/getting-started.md.

Getting Started

This guide will help you install and configure react-native-nitro-device-info in your React Native project.

Prerequisites

Before installing, ensure your project meets these requirements:

  • React Native: Use a version supported by your installed Nitro runtime. The repository examples use React Native 0.85.3; this does not establish a minimum supported version.
  • iOS: Deployment target 15.1 or higher
  • Android: minSdkVersion 24 or higher (Android 7.0 Nougat)
  • Node.js: Follow your React Native toolchain requirements. Repository development uses Node.js 22.

The iOS and Android values above are this library’s native build settings. React Native or Nitro can require a higher minimum.

Installation

Install the library and its peer dependency using your preferred package manager:

# npm
npm install react-native-nitro-device-info react-native-nitro-modules

# yarn
yarn add react-native-nitro-device-info react-native-nitro-modules

# pnpm
pnpm add react-native-nitro-device-info react-native-nitro-modules

Important: react-native-nitro-modules >=0.35.0 <1.0.0 is required as a peer dependency for JSI bindings.

Platform Setup

iOS Configuration

After installation, install the CocoaPods dependencies:

cd ios && pod install && cd ..

Rebuild the iOS app after installing the pods. Restarting Metro alone does not install native code.

iOS Privacy Manifest

v1.9.0: Privacy manifest bundling is available from 1.9.0 and is not included in 1.8.3. See PR #144.

The pod packages ios/PrivacyInfo.xcprivacy in NitroDeviceInfo_privacy.bundle. CocoaPods copies this resource bundle into the app, including when Expo prebuild or EAS Build installs the pod. No privacy-specific config plugin option or manual copy into the app target is needed.

The declarations follow the resource-bundle pattern used by Expo Device, with reasons selected for the APIs this library uses:

API categoryLibrary APIsDeclared reasons
File timestampgetFirstInstallTime() and getLastUpdateTime() read metadata inside the app container. firstInstallTimeSync reads metadata on its first access, then returns a cached value; lastUpdateTimeSync returns -1 on iOS.C617.1, also used by Expo Application
Disk spacetotalDiskCapacity, getFreeDiskStorage() and their legacy variantsE174.1, 85F4.1, also used by Expo FileSystem
System boot timegetUptime() for elapsed time between app events or timers; startupTime for converting app-event uptime into an absolute timestamp35F9.1 for elapsed time/timers; 8FFB.1 for app-event timestamps

These reasons have Apple-defined usage limits. Disk-space data is for visible storage information or storage-dependent app behavior, with restrictions on sending it off-device.

On iOS, the supported uses of getUptime() and startupTime are limited to the app-event timing purposes in the table. Raw device uptime and boot timestamps must not be displayed or collected as general device information, sent off-device, or used for fingerprinting. Under 35F9.1, only elapsed time between events within the app may be sent off-device. Under 8FFB.1, only the resulting absolute timestamps of events within the app may be sent off-device. See the timing API examples. Expo Device also declares 35F9.1, but its declaration does not authorize broader usage of these APIs.

The library declares no collected data or tracking of its own. Your app remains responsible for declarations covering its own data collection, tracking, and other SDKs. Do not use these APIs for device fingerprinting.

After building or archiving the iOS app, verify that the app contains NitroDeviceInfo_privacy.bundle/PrivacyInfo.xcprivacy. Existing app-level privacy manifests can remain in place.

Android Configuration

Gradle autolinking registers the library when you rebuild your Android app. Permission-dependent APIs can still require configuration; see Expo Setup.

Expo apps

Use a development build or EAS Build. Expo Go does not include this native module. Follow Expo Setup for installation, native configuration, and rebuilding.

Verify Installation

To verify the installation was successful, add this code to your app:

import { DeviceInfoModule } from 'react-native-nitro-device-info';

console.log('Device ID:', DeviceInfoModule.deviceId);
console.log('Brand:', DeviceInfoModule.brand);
console.log('System Version:', DeviceInfoModule.systemVersion);

If you see device information logged to the console, the installation was successful!

Next Steps

Now that you have the library installed, check out the Quick Start guide to learn how to use it in your app.

You can also: