DeviceInfoAdapter
Device adapter for bare React Native projects using react-native-device-info.
The DeviceInfoAdapter uses react-native-device-info to collect device information in bare React Native projects.
Installation
npm install react-native-device-info
# or
bun add react-native-device-infoFor iOS, run pod install:
cd ios && pod installUsage
import { TeardownCore } from '@teardown/react-native';
import { DeviceInfoAdapter } from '@teardown/react-native/adapters/device-info';
import { MMKVStorageAdapter } from '@teardown/react-native/adapters/mmkv';
export const teardown = new TeardownCore({
org_id: 'your-org-id',
project_id: 'your-project-id',
api_key: 'your-api-key',
storageAdapter: new MMKVStorageAdapter(),
deviceAdapter: new DeviceInfoAdapter(),
});Import Path
import { DeviceInfoAdapter } from '@teardown/react-native/adapters/device-info';Collected Data
Application Info
version- FromgetVersion()buildNumber- FromgetBuildNumber()bundleId- FromgetBundleId()
Hardware Info
deviceName- FromgetDeviceName()brand- FromgetBrand()deviceType- FromgetDeviceType()(phone, tablet, desktop, tv, unknown)
OS Info
osName- FromgetSystemName()osVersion- FromgetSystemVersion()
When to Use
- Bare React Native CLI projects
- Projects not using Expo modules
- Projects requiring additional device info beyond what Expo provides
Requirements
react-native-device-info>= 10.0.0- React Native >= 0.60 (autolinking)
Platform Notes
iOS
Requires pod install after installation.
Android
Works out of the box with autolinking.