Quick Start
Complete Getting Started or Expo Setup and rebuild your native app first.
This page uses the native API from the package root. For react-native-device-info-style functions, use the /compat entry point.
Read a property, call a method, await a Promise
getBatteryLevel() returns -1 when unavailable. getHasGms() returns false on iOS. Promise return types do not specify a completion deadline.
Display changing values in React
A direct getter reads a snapshot. Use a hook when the component must update as the value changes.
useBatteryLevel() reads after mount and polls every five seconds. It returns null before the first reading or when the battery level is unavailable. See React Hooks for update intervals and other return types.
Check units and unsupported values
See DeviceInfo Module for exact signatures, caching, permissions, and platform behavior. Web uses fallback values.
Next steps
- Basic Usage: examples grouped by task
- API Reference: find properties, methods, hooks, and types
- Migration Guide: choose compatibility or native APIs
