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/force-updates';
import { DeviceInfoAdapter } from '@teardown/force-updates/adapters/device-info';
import { MMKVStorageAdapter } from '@teardown/force-updates/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/force-updates/adapters/device-info';Collected Data
Application Info
version- FromgetVersion()build_number- FromgetBuildNumber()(as number)
Hardware Info
device_name- FromgetDeviceName()device_brand- FromgetBrand()device_type- FromgetDeviceType()(phone, tablet, desktop, tv, unknown)
OS Info
platform- Mapped from React NativePlatform.OStoDevicePlatformEnumname- FromgetSystemName()version- 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>= 15.0.0- React Native >= 0.60 (autolinking)
Platform Notes
iOS
Requires pod install after installation.
Android
Works out of the box with autolinking.