Teardown

ExpoDeviceAdapter

Device adapter for Expo projects using expo-device and expo-application.

The ExpoDeviceAdapter uses Expo's native modules to collect device information.

Installation

npx expo install expo-device expo-application

Usage

import { TeardownCore } from '@teardown/force-updates';
import { ExpoDeviceAdapter } from '@teardown/force-updates/adapters/expo';
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 ExpoDeviceAdapter(),
});

Import Path

import { ExpoDeviceAdapter } from '@teardown/force-updates/adapters/expo';

Collected Data

Application Info

  • version - From expo-application nativeApplicationVersion
  • build_number - From expo-application nativeBuildVersion (as number)

Hardware Info

  • device_name - From expo-device deviceName
  • device_brand - From expo-device brand
  • device_type - From expo-device deviceType (phone, tablet, desktop, tv, unknown)

OS Info

  • platform - Mapped from React Native Platform.OS to DevicePlatformEnum
  • name - From expo-device osName
  • version - From expo-device osVersion

When to Use

  • Expo managed workflow projects
  • Expo bare workflow projects using Expo modules
  • Projects using Expo SDK 50+

Requirements

  • expo-device >= 8.0.0
  • expo-application >= 7.0.0