Device Information for React Native iOS and Android

Overview

react-native-device-info

npm version npm total downloads npm monthly downloads npm weekly downloads

Device Information for React Native.

TOC

v6 to v7 upgrade

Your iOS Podfile will need to move to an iOS 10 minimum. v7 of this module no longer supports iOS9.

Installation

Using npm:

npm install --save react-native-device-info

or using yarn:

yarn add react-native-device-info

Proguard

If you want to use Install Referrer tracking, you will need to add this config to your Proguard config

-keepclassmembers class com.android.installreferrer.api.** {
  *;
}

AndroidX Support

This module defaults to AndroidX you should configure your library versions similar to this in your android/build.gradle file's "ext" block

Android
...
  ext {
    // dependency versions

    We have 3 options for deviceId:
    //Option 1 (latest):
    firebaseIidVersion = "19.0.1" // default: "19.0.1"
    //Option 2 (legacy GooglePlay dependency but using AndroidX):
    googlePlayServicesIidVersion = "17.0.0" // default: "17.0.0" - AndroidX
    //Option 3 (legacy GooglePlay dependency before AndroidX):
    googlePlayServicesIidVersion = "16.0.1"


    //include as needed:
    compileSdkVersion = "28" // default: 28 (28 is required for AndroidX)
    targetSdkVersion = "28" // default: 28 (28 is required for AndroidX)
    supportLibVersion = '1.0.2' // Use '28.0.0' or don't specify for old libraries, '1.0.2' or similar for AndroidX
    mediaCompatVersion = '1.0.1' // Do not specify if using old libraries, specify '1.0.1' or similar for androidx.media:media dependency
    supportV4Version = '1.0.0' // Do not specify if using old libraries, specify '1.0.0' or similar for androidx.legacy:legacy-support-v4 dependency
  }
...

If you need non-AndroidX you will need to use the jetifier package in reverse mode, documentation available with that package.

Linking

Linking in native modules is a frequent source of trouble for new react-native developers, resulting in errors like "RNDeviceInfo is null" etc. For this reason automatic linking was implemented, and it should be used in your project.

Automatic linking is supported for all platforms (even windows on React native >= 0.63!)

Previous versions need to do manual linking. No support is offered for these previous react-native versions but you may refer to older versions of this README if you like. Upgrade to modern versions of react-native. Use upgrade-helper tool on the internet if needed.

Usage

import DeviceInfo from 'react-native-device-info';

// or ES6+ destructured imports

import { getUniqueId, getManufacturer } from 'react-native-device-info';

API

Note that many APIs are platform-specific. If there is no implementation for a platform, then the "default" return values you will receive are "unknown" for string, -1 for number, and false for boolean. Arrays and Objects will be empty ([] and {} respectively).

Most APIs return a Promise but also have a corresponding API with Sync on the end that operates synchronously. For example, you may prefer to call isCameraPresentSync() during your app bootstrap to avoid async calls during the first parts of app startup.

The example app in this repository shows an example usage of every single API, consult the example app if you have questions, and if you think you see a problem make sure you can reproduce it using the example app before reporting it, thank you.

Method Return Type  iOS Android Windows Web
getAndroidId() Promise<string>
getApiLevel() Promise<number>
getApplicationName() string
getAvailableLocationProviders() Promise<Object>
getBaseOs() Promise<string>
getBuildId() Promise<string>
getBatteryLevel() Promise<number>
getBootloader() Promise<string>
getBrand() string
getBuildNumber() string
getBundleId() string
isCameraPresent() Promise<boolean>
getCarrier() Promise<string>
getCodename() Promise<string>
getDevice() Promise<string>
getDeviceId() string
getDeviceType() string
getDisplay() Promise<string>
getDeviceName() Promise<string>
getDeviceToken() Promise<string>
getFirstInstallTime() Promise<number>
getFingerprint() Promise<string>
getFontScale() Promise<number>
getFreeDiskStorage() Promise<number>
getFreeDiskStorageOld() Promise<number>
getHardware() Promise<string>
getHost() Promise<string>
getIpAddress() Promise<string>
getIncremental() Promise<string>
getInstallerPackageName() Promise<string>
getInstallReferrer() Promise<string>
getInstanceId() Promise<string>
getLastUpdateTime() Promise<number>
getMacAddress() Promise<string>
getManufacturer() Promise<string>
getMaxMemory() Promise<number>
getModel() string
getPhoneNumber() Promise<string>
getPowerState() Promise<object>
getProduct() Promise<string>
getPreviewSdkInt() Promise<number>
getReadableVersion() string
getSerialNumber() Promise<string>
getSecurityPatch() Promise<string>
getSystemAvailableFeatures() Promise<string[]>
getSystemName() string
getSystemVersion() string
getTags() Promise<string>
getType() Promise<string>
getTotalDiskCapacity() Promise<number>
getTotalDiskCapacityOld() Promise<number>
getTotalMemory() Promise<number>
getUniqueId() string
getUsedMemory() Promise<number>
getUserAgent() Promise<string>
getVersion() string
hasGms() Promise<boolean>
hasHms() Promise<boolean>
hasNotch() boolean
hasSystemFeature() Promise<boolean>
isAirplaneMode() Promise<boolean>
isBatteryCharging() Promise<boolean>
isEmulator() Promise<boolean>
isLandscape() Promise<boolean>
isLocationEnabled() Promise<boolean>
isHeadphonesConnected() Promise<boolean>
isPinOrFingerprintSet() Promise<boolean>
isTablet() boolean
supported32BitAbis() Promise<string[]>
supported64BitAbis() Promise<string[]>
supportedAbis() Promise<string[]>
syncUniqueId() Promise<string>

getApiLevel()

Gets the API level.

Examples

DeviceInfo.getApiLevel().then((apiLevel) => {
  // iOS: ?
  // Android: 25
  // Windows: ?
});

Notes

See API Levels


getAndroidId()

Gets the ANDROID_ID. See API documentation for appropriate use.

Examples

DeviceInfo.getAndroidId().then((androidId) => {
  // androidId here
});

getApplicationName()

Gets the application name.

Examples

let appName = DeviceInfo.getApplicationName();
// AwesomeApp

getBaseOs()

The base OS build the product is based on.

Examples

DeviceInfo.getBaseOs().then((baseOs) => {
  // "Windows", "Android" etc
});

getBatteryLevel()

Gets the battery level of the device as a float comprised between 0 and 1.

Examples

DeviceInfo.getBatteryLevel().then((batteryLevel) => {
  // 0.759999
});

Notes

To be able to get actual battery level enable battery monitoring mode for application. Add this code:

[UIDevice currentDevice].batteryMonitoringEnabled = true;

to AppDelegate.m application:didFinishLaunchingWithOptions:

Returns -1 on the iOS Simulator


getBootloader()

The system bootloader version number.

Examples

DeviceInfo.getBootloader().then((bootloader) => {
  // "mw8998-002.0069.00"
});

getBrand()

Gets the device brand.

Examples

let brand = DeviceInfo.getBrand();
// iOS: "Apple"
// Android: "xiaomi"
// Windows: ?

getBuildNumber()

Gets the application build number.

Examples

let buildNumber = DeviceInfo.getBuildNumber();
// iOS: "89"
// Android: "4"
// Windows: ?

getBundleId()

Gets the application bundle identifier.

Examples

let bundleId = DeviceInfo.getBundleId();
// "com.example.AwesomeApp"

isCameraPresent()

Tells if the device has any camera now.

Examples

DeviceInfo.isCameraPresent()
  .then((isCameraPresent) => {
    // true or false
  })
  .catch((cameraAccessException) => {
    // is thrown if a camera device could not be queried or opened by the CameraManager on Android
  });

Notes

  • Hot add/remove of camera is supported.
  • Returns the status of the physical presence of the camera. If camera present but your app don't have permissions to use it, isCameraPresent will still return the true

getCarrier()

Gets the carrier name (network operator).

Examples

DeviceInfo.getCarrier().then((carrier) => {
  // "SOFTBANK"
});

getCodename()

The current development codename, or the string "REL" if this is a release build.

Examples

DeviceInfo.getCodename().then((codename) => {
  // "REL"
});

getDevice()

The name of the industrial design.

Examples

DeviceInfo.getDevice().then((device) => {
  // "walleye"
});

getDeviceId()

Gets the device ID.

Examples

let deviceId = DeviceInfo.getDeviceId();
// iOS: "iPhone7,2"
// Android: "goldfish"
// Windows: ?

getDisplay()

A build ID string meant for displaying to the user.

Examples

DeviceInfo.getDisplay().then((display) => {
  // "OPM2.171026.006.G1"
});

getDeviceName()

Gets the device name.

Examples

DeviceInfo.getDeviceName().then((deviceName) => {
  // iOS: "Becca's iPhone 6"
  // Android: ?
  // Windows: ?
});

This used to require the android.permission.BLUETOOTH but the new implementation in v3 does not need it. You may remove that from your AndroidManifest.xml if you had it for this API.


getDeviceToken()

Gets the device token (see DeviceCheck). Only available for iOS 11.0+ on real devices. This will reject the promise when getDeviceToken is not supported, be careful with exception handling.

Examples

DeviceInfo.getDeviceToken().then((deviceToken) => {
  // iOS: "a2Jqsd0kanz..."
});

getFirstInstallTime()

Gets the time at which the app was first installed, in milliseconds.

Examples

DeviceInfo.getFirstInstallTime().then((firstInstallTime) => {
  // Android: 1517681764528
});

getFingerprint()

A string that uniquely identifies this build.

Examples

DeviceInfo.getFingerprint().then((fingerprint) => {
  // "google/walleye/walleye:8.1.0/OPM2.171026.006.G1/4820017:user/release-keys"
});

getFontScale()

Gets the device font scale. The font scale is the ratio of the current system font to the "normal" font size, so if normal text is 10pt and the system font is currently 15pt, the font scale would be 1.5 This can be used to determine if accessability settings has been changed for the device; you may want to re-layout certain views if the font scale is significantly larger ( > 2.0 )

Examples

DeviceInfo.getFontScale().then((fontScale) => {
  // 1.2
});

getFreeDiskStorage()

Method that gets available storage size, in bytes, taking into account both root and data file systems calculation.

Examples

DeviceInfo.getFreeDiskStorage().then((freeDiskStorage) => {
  // Android: 17179869184
  // iOS: 17179869184
});

Notes

The API used by this method for Android was changed in v6.0.0. The older version has been maintained below as getFreeDiskStorageOld(). On iOS, getFreeDiskStorage() and getFreeDiskStorageOld() return the same value.


getFreeDiskStorageOld()

Old implementation of method that gets available storage size, in bytes.

Examples

DeviceInfo.getFreeDiskStorageOld().then((freeDiskStorage) => {
  // Android: 17179869184
  // iOS: 17179869184
});

Notes

From developer.android.com:

This method was deprecated in API level 29.

Return the primary shared/external storage directory.

Note: don't be confused by the word "external" here. This directory can better be thought as media/shared storage. It is a filesystem that can hold a relatively large amount of data and that is shared across all applications (does not enforce permissions). Traditionally this is an SD card, but it may also be implemented as built-in storage in a device that is distinct from the protected internal storage and can be mounted as a filesystem on a computer.


getHardware()

The name of the hardware (from the kernel command line or /proc).

Examples

DeviceInfo.getHardware().then(hardware => {
  // "walleye"
};

getHost()

Hostname

Examples

DeviceInfo.getHost().then((host) => {
  // "wprd10.hot.corp.google.com"
});

getIpAddress()

Deprecated Gets the device current IP address. (of wifi only) Switch to @react-native-community/netinfo or react-native-network-info

Examples

DeviceInfo.getIpAddress().then((ip) => {
  // "92.168.32.44"
});

Android Permissions

Notes

Support for iOS was added in 0.22.0


getIncremental()

The internal value used by the underlying source control to represent this build.

Examples

DeviceInfo.getIncremental().then((incremental) => {
  // "4820017"
});

getInstallerPackageName()

The internal value used by the underlying source control to represent this build.

Examples

DeviceInfo.getInstallerPackageName().then((installerPackageName) => {
  // Play Store: "com.android.vending"
  // Amazon: "com.amazon.venezia"
  // Samsung App Store: "com.sec.android.app.samsungapps"
  // iOS: "AppStore", "TestFlight", "Other"
});

getInstallReferrer()

Gets the referrer string upon application installation.

Examples

DeviceInfo.getInstallReferrer().then((installReferrer) => {
  // If the app was installed from https://play.google.com/store/apps/details?id=com.myapp&referrer=my_install_referrer
  // the result will be "my_install_referrer"
});

getInstanceId()

Gets the application instance ID.

Examples

DeviceInfo.getInstanceId().then((instanceId) => {
  // Android: ?
});

Notes

See https://developers.google.com/instance-id/


getLastUpdateTime()

Gets the time at which the app was last updated, in milliseconds.

Examples

DeviceInfo.getLastUpdateTime().then((lastUpdateTime) => {
  // Android: 1517681764992
});

getMacAddress()

Gets the network adapter MAC address.

Examples

DeviceInfo.getMacAddress().then((mac) => {
  // "E5:12:D8:E5:69:97"
});

Android Permissions

Notes

iOS: This method always return "02:00:00:00:00:00" as retrieving the MAC address is disabled since iOS 7


getManufacturer()

Gets the device manufacturer.

Examples

DeviceInfo.getManufacturer().then((manufacturer) => {
  // iOS: "Apple"
  // Android: "Google"
  // Windows: ?
});

getMaxMemory()

Returns the maximum amount of memory that the VM will attempt to use, in bytes.

Examples

DeviceInfo.getMaxMemory().then((maxMemory) => {
  // 402653183
});

getModel()

Gets the device model.

iOS warning: The list with device names is maintained by the community and could lag new devices. It is recommended to use getDeviceId() since it's more reliable and always up-to-date with new iOS devices. We do accept pull requests that add new iOS devices to the list with device names.

Examples

let model = DeviceInfo.getModel();
// iOS: ?
// Android: ?
// Windows: ?

getPhoneNumber()

Gets the device phone number.

Examples

DeviceInfo.getPhoneNumber().then((phoneNumber) => {
  // Android: null return: no permission, empty string: unprogrammed or empty SIM1, e.g. "+15555215558": normal return value
});

Android Permissions

Notes

This can return undefined in certain cases and should not be relied on. SO entry on the subject.


getPowerState()

Gets the power state of the device including the battery level, whether it is plugged in, and if the system is currently operating in low power mode. Displays a warning on iOS if battery monitoring not enabled, or if attempted on an emulator (where monitoring is not possible)

Examples

DeviceInfo.getPowerState().then((state) => {
  // {
  //   batteryLevel: 0.759999,
  //   batteryState: 'unplugged',
  //   lowPowerMode: false,
  // }
});

getProduct()

The name of the overall product.

Examples

DeviceInfo.getProduct().then((product) => {
  // "walleye"
});

getPreviewSdkInt()

The developer preview revision of a prerelease SDK.

Examples

DeviceInfo.getPreviewSdkInt().then((previewSdkInt) => {
  // 0
});

getReadableVersion()

Gets the application human readable version (same as getVersion() + '.' + getBuildNumber())

Examples

let readableVersion = DeviceInfo.getReadableVersion();
// iOS: 1.0.1.32
// Android: 1.0.1.234
// Windows: ?

getSerialNumber()

Gets the device serial number. Will be 'unknown' in almost all cases unless you have a privileged app and you know what you're doing.

Examples

DeviceInfo.getSerialNumber().then((serialNumber) => {
  // iOS: unknown
  // Android: ? (maybe a serial number, if your app is privileged)
  // Windows: unknown
});

getSecurityPatch()

The user-visible security patch level.

Examples

DeviceInfo.getSecurityPatch().then((securityPatch) => {
  // "2018-07-05"
});

getSystemName()

Gets the device OS name.

Examples

let systemName = DeviceInfo.getSystemName();
// iOS: "iOS" on newer iOS devices "iPhone OS" on older devices, including older iPad's.
// Android: "Android"
// Windows: ?

getSystemVersion()

Gets the device OS version.

Examples

let systemVersion = DeviceInfo.getSystemVersion();
// iOS: "11.0"
// Android: "7.1.1"
// Windows: ?

getBuildId()

Gets build number of the operating system.

Examples

DeviceInfo.getBuildId().then((buildId) => {
  // iOS: "12A269"
  // tvOS: not available
  // Android: "13D15"
  // Windows: not available
});

getTags()

Comma-separated tags describing the build.

Examples

DeviceInfo.getTags().then((tags) => {
  // "release-keys, unsigned, debug",
});

getType()

The type of build.

Examples

DeviceInfo.getType().then((type) => {
  // "user", "eng"
});

getTotalDiskCapacity()

Method that gets full disk storage size, in bytes, taking into account both root and data file systems calculation.

Examples

DeviceInfo.getTotalDiskCapacity().then((capacity) => {
  // Android: 17179869184
  // iOS: 17179869184
});

Notes

The API used by this method for Android was changed in v6.0.0. The older version has been maintained below as getTotalDiskCapacityOld(). On iOS, getTotalDiskCapacity() and getTotalDiskCapacityOld() return the same value.


getTotalDiskCapacityOld()

Old implementation of method that gets full disk storage size, in bytes.

Examples

DeviceInfo.getTotalDiskCapacityOld().then((capacity) => {
  // Android: 17179869184
  // iOS: 17179869184
});

getTotalMemory()

Gets the device total memory, in bytes.

Examples

DeviceInfo.getTotalMemory().then((totalMemory) => {
  // 1995018240
});

getUniqueId()

This is a constant and may be referenced directly

Gets the device unique ID. On Android it is currently identical to getAndroidId() in this module. On iOS it uses the DeviceUID uid identifier. On Windows it uses Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation.id.

Examples

let uniqueId = DeviceInfo.getUniqueId();
// iOS: "FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9"
// Android: "dd96dec43fb81c97"
// Windows: ?

Notes

  • iOS: This is IDFV or a random string if IDFV is unavaliable. Once UID is generated it is stored in iOS Keychain and NSUserDefaults. So it would stay the same even if you delete the app or reset IDFV. You can carefully consider it a persistent, cross-install unique ID. It can be changed only in case someone manually override values in Keychain/NSUserDefaults or if Apple would change Keychain and NSUserDefaults implementations. Beware: The IDFV is calculated using your bundle identifier and thus will be different in app extensions.
  • android: Prior to Oreo, this id (ANDROID_ID) will always be the same once you set up your phone.

syncUniqueId()

This method is intended for iOS.

This synchronizes uniqueId with IDFV or sets new a random string.

On iOS it uses the DeviceUID uid identifier. On other platforms it just call getUniqueId() in this module.

Examples

DeviceInfo.syncUniqueId().then((uniqueId) => {
  // iOS: "FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9"
  // Android: "dd96dec43fb81c97"
  // Windows: ?
});

Notes

  • If user moved or restored data from one iOS device to second iOS device then he will have two different devices with same uniqueId in Keychain/NSUserDefaults. User can call syncUniqueId() on new iOS device. That will update his uniqueId from IDFV or a random string.

getUsedMemory()

Gets the app memory usage, in bytes.

Examples

DeviceInfo.getUsedMemory().then((usedMemory) => {
  // 23452345
});

getUserAgent()

Gets the device User Agent.

Examples

DeviceInfo.getUserAgent().then((userAgent) => {
  // iOS: "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143"
  // tvOS: not available
  // Android: ?
  // Windows: ?
});

getVersion()

Gets the application version.

Examples

let version = DeviceInfo.getVersion();
// iOS: "1.0"
// Android: "1.0"
// Windows: ?

isAirplaneMode()

Tells if the device is in Airplane Mode.

Examples

DeviceInfo.isAirplaneMode().then((airplaneModeOn) => {
  // false
});

Notes

  • This only works if the remote debugger is disabled.

isBatteryCharging()

Tells if the battery is currently charging.

Examples

DeviceInfo.isBatteryCharging().then((isCharging) => {
  // true or false
});

isEmulator()

Tells if the application is running in an emulator.

Examples

DeviceInfo.isEmulator().then((isEmulator) => {
  // false
});

isPinOrFingerprintSet()

Tells if a PIN number or a fingerprint was set for the device.

Examples

DeviceInfo.isPinOrFingerprintSet().then((isPinOrFingerprintSet) => {
  if (!isPinOrFingerprintSet) {
    // ...
  }
});

isTablet()

Tells if the device is a tablet.

Examples

let isTablet = DeviceInfo.isTablet();
// true

isLandscape()

Tells if the device is currently in landscape mode.

Examples

DeviceInfo.isLandscape().then((isLandscape) => {
  // true
});

hasGms()

Tells if the device supports Google Mobile Services.

Examples

DeviceInfo.hasGms().then((hasGms) => {
  // true
});

hasHms()

Tells if the device supports Huawei Mobile Services.

Examples

DeviceInfo.hasHms().then((hasHms) => {
  // true
});

hasNotch()

Tells if the device has a notch.

Examples

let hasNotch = DeviceInfo.hasNotch();
// true

getDeviceType()

Returns the device's type as a string, which will be one of:

  • Handset
  • Tablet
  • Tv
  • Desktop
  • unknown

Examples

let type = DeviceInfo.getDeviceType();
// 'Handset'

supported32BitAbis()

An ordered list of 32 bit ABIs supported by this device.

Examples

DeviceInfo.supported32BitAbis().then((abis) => {
  // ["armeabi-v7a", "armeabi"]
});

supported64BitAbis()

An ordered list of 64 bit ABIs supported by this device.

Examples

DeviceInfo.supported64BitAbis().then((abis) => {
  // ["arm64-v8a"]
});

supportedAbis()

Returns a list of supported processor architecture version

Examples

DeviceInfo.supportedAbis().then((abis) => {
  // [ "arm64 v8", "Intel x86-64h Haswell", "arm64-v8a", "armeabi-v7a", "armeabi" ]
});

hasSystemFeature(feature)

Tells if the device has a specific system feature.

Examples

DeviceInfo.hasSystemFeature('amazon.hardware.fire_tv').then((hasFeature) => {
  // true or false
});

getSystemAvailableFeatures()

Returns a list of available system features on Android.

Examples

DeviceInfo.getSystemAvailableFeatures().then((features) => {
  // ["android.software.backup", "android.hardware.screen.landscape", "android.hardware.wifi", ...]
});

isLocationEnabled()

Tells if the device has location services turned off at the device-level (NOT related to app-specific permissions)

Examples

DeviceInfo.isLocationEnabled().then((enabled) => {
  // true or false
});

isHeadphonesConnected()

Tells if the device is connected to wired headset or bluetooth headphones

Examples

DeviceInfo.isHeadphonesConnected().then((enabled) => {
  // true or false
});

getAvailableLocationProviders()

Returns an object of platform-specfic location providers/servcies, with boolean value whether or not they are currently available.

NOTE: This function requires access to the Location permission on Android

Android Example

DeviceInfo.getAvailableLocationProviders().then((providers) => {
  // {
  //   gps: true
  //   network: true
  //   passive: true
  // }
});

iOS Example

DeviceInfo.getAvailableLocationProviders().then((providers) => {
  // {
  //   headingAvailable: false
  //   isRangingAvailable: false
  //   locationServicesEnabled: true
  //   significantLocationChangeMonitoringAvailable: true
  // }
});

Hooks & Events

Currently iOS & Android only (web support for battery/charging-related APIs).

useBatteryLevel or RNDeviceInfo_batteryLevelDidChange

Fired when the battery level changes; sent no more frequently than once per minute.

Examples

import { useBatteryLevel } from 'react-native-device-info';

const batteryLevel = useBatteryLevel(); // 0.759999

<Text>{batteryLevel}</Text>;
import { NativeEventEmitter, NativeModules } from 'react-native';
const deviceInfoEmitter = new NativeEventEmitter(NativeModules.RNDeviceInfo);

deviceInfoEmitter.addListener('RNDeviceInfo_batteryLevelDidChange', (level) => {
  // 0.759999
});

useBatteryLevelIsLow or RNDeviceInfo_batteryLevelIsLow

Fired when the battery drops is considered low

Platform Percentage
iOS 20
Android 15
Web 20

Examples

import { useBatteryLevelIsLow } from 'react-native-device-info';

const batteryLevelIsLow = useBatteryLevelIsLow(); // 0.19

<Text>{batteryLevelIsLow}</Text>;
import { NativeEventEmitter, NativeModules } from 'react-native';
const deviceInfoEmitter = new NativeEventEmitter(NativeModules.RNDeviceInfo);

deviceInfoEmitter.addListener('RNDeviceInfo_batteryLevelIsLow', (level) => {
  // 0.19
});

usePowerState or RNDeviceInfo_powerStateDidChange

Fired when the battery state changes, for example when the device enters charging mode or is unplugged.

Examples

import { usePowerState } from 'react-native-device-info';

const powerState = usePowerState(); // 'charging'

<Text>{powerState}</Text>;
import { NativeEventEmitter, NativeModules } from 'react-native'
const deviceInfoEmitter = new NativeEventEmitter(NativeModules.RNDeviceInfo)

deviceInfoEmitter.addListener('RNDeviceInfo_powerStateDidChange', { batteryState } => {
  // 'charging'
});

useFirstInstallTime

Gets the time at which the app was first installed, in milliseconds.

Example

import { useFirstInstallTime } from 'react-native-device-info';

const { loading, result } = useFirstInstallTime(); // { loading: true, result: 1517681764528}

<Text>{loading ? 'loading...' : result}</Text>;

useDeviceName

Gets the device name.

Example

import { useDeviceName } from 'react-native-device-info';

const { loading, result } = useDeviceName(); // { loading: true, result: "Becca's iPhone 6"}

<Text>{loading ? 'loading...' : result}</Text>;

useHasSystemFeature

Tells if the device has a specific system feature.

Example

import { useHasSystemFeature } from 'react-native-device-info';

const { loading, result } = useHasSystemFeature('amazon.hardware.fire_tv'); // { loading: true, result: false }

<Text>{loading ? 'loading...' : result}</Text>;

useIsEmulator

Get whether the application is running in an emulator.

Example

import { useIsEmulator } from 'react-native-device-info';

const { loading, result } = useIsEmulator(); // { loading: true, result: false }

<Text>{loading ? 'loading...' : result}</Text>;

useManufacturer

Gets the device manufacturer.

Example

import { useManufacturer } from 'react-native-device-info';

const { loading, result } = useManufacturer(); // { loading: true, result: "Apple"}

<Text>{loading ? 'loading...' : result}</Text>;

useIsHeadphonesConnected

Tells if the device is connected to wired headset or bluetooth headphones.

This hook subscribes to the event, RNDeviceInfo_headphoneConnectionDidChange , and updates the result field accordingly.

Example

import { useIsHeadphonesConnected } from 'react-native-device-info';

const { loading, result } = useIsHeadphonesConnected(); // { loading: true, result: false}

<Text>{loading ? 'loading...' : result}</Text>;

=======

Native interoperatibily

If you need to check for device type from the native side, you can use the following:

import com.learnium.resolver.DeviceTypeResolver

...
deviceTypeResolver = new DeviceTypeResolver(context);
...
//Check if the device is a Tablet:
if(deviceTypeResolver.isTablet){
  ...
}else{
  ...
}

Troubleshooting

When installing or using react-native-device-info, you may encounter the following problems:

[android] - Unable to merge dex / Multiple dex files / Problems with `com.google.android.gms`

react-native-device-info uses com.google.android.gms:play-services-gcm to provide getInstanceId(). This can lead to conflicts when building the Android application.

If you're using a different version of com.google.android.gms:play-services-gcm in your app, you can define the googlePlayServicesVersion gradle variable in your build.gradle file to tell react-native-device-info what version it should require. See the example project included here for a sample.

If you're using a different library that conflicts with com.google.android.gms:play-services-gcm, and you are certain you know what you are doing such that you will avoid version conflicts, you can simply ignore this dependency in your gradle file:

 compile(project(':react-native-device-info')) {
    exclude group: 'com.google.android.gms'
}
[ios] - ld: library not found for -lRNDeviceInfo-tvOS

Seems to be a bug caused by react-native link. You can manually delete libRNDeviceInfo-tvOS.a in Xcode -> [Your iOS build target] -> Build Phrases -> Link Binary with Libraries.

[ios] - [NetworkInfo] Descriptors query returned error: Error Domain=NSCocoaErrorDomain Code=4099 “The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.”

This is a system level log that may be turned off by executing: xcrun simctl spawn booted log config --mode "level:off" --subsystem com.apple.CoreTelephony. To undo the command, you can execute: xcrun simctl spawn booted log config --mode "level:info" --subsystem com.apple.CoreTelephony

[ios] - Multiple versions of React when using CocoaPods "tries to require 'react-native' but there are several files providing this module"

RN<=59 You may need to adjust your Podfile like this if you use Cocoapods and have undefined symbols or duplicate React definitions

target 'yourTargetName' do
  # See http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge', # Include this for RN >= 0.47
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # Needed for debugging
    'RCTAnimation', # Needed for FlatList and animations running on native UI thread
    # Add any other subspecs you want to use in your project
  ]

  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third party deps podspec link - you may have multiple pods here, just an example
  pod 'RNDeviceInfo', path: '../node_modules/react-native-device-info'

end

# if you see errors about React duplicate definitions, this fixes it. The same works for yoga.
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end
[tests] - Cannot run my test suite when using this library

react-native-device-info contains native code, and needs to be mocked. Jest Snapshot support may work though.

If you do not have a Jest Setup file configured, you should add the following to your Jest settings and create the jest.setup.js file in project root:

setupFiles: ['<rootDir>/jest.setup.js'];

You should then add the following to your Jest setup file to mock the DeviceInfo Native Module:

import mockRNDeviceInfo from 'react-native-device-info/jest/react-native-device-info-mock';

jest.mock('react-native-device-info', () => mockRNDeviceInfo);

Checkout the example project for more information.

[warnings] - I get too many warnings (battery state, etc)

Some of the APIs (like getBatteryState) will throw warnings in certain conditions like on tvOS or the iOS emulator. This won't be visible in production but even in development it may be irritating. It is useful to have the warnings because these devices return no state, and that can be surprising, leading to github support issues. The warnings is intended to educate you as a developer. If the warnings are troublesome you may try this in your code to suppress them:

import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Battery state']);

Release Notes

See the CHANGELOG.md.

Contributing

Please see the contributing guide.

react-native-dom

As a courtesy to developers, this library was made compatible in v0.21.6 with react-native-dom and react-native-web by providing an empty polyfill in order to avoid breaking builds.

Only getUserAgent() will return a correct value. All other API methods will return an "empty" value of its documented return type: 0 for numbers, '' for strings, false for booleans.

Comments
  • Required dispatch_sync to load constants for RNDeviceInfo. This may lead to deadlocks

    Required dispatch_sync to load constants for RNDeviceInfo. This may lead to deadlocks

    I'm getting this warning on 0.49.5 Required dispatch_sync to load constants for RNDeviceInfo. This may lead to deadlocks

    Everything seems to function fine, but I'm wondering what does this exactly mean?

    ios bc-break 
    opened by compojoom 52
  • feat(windows, isTabletMode, isKeyboardConnected, isMouseConnected, DeviceType GamingConsole) and fix(windows, isTablet): revise condition

    feat(windows, isTabletMode, isKeyboardConnected, isMouseConnected, DeviceType GamingConsole) and fix(windows, isTablet): revise condition

    Added isTabletMode, isKeyboardConnected, and isMouseConnected Fixed IsTablet returning true when we are on a desktop windows (i.e. not on a tablet).

    Description

    • Window's has devices that can have 2 interaction modes, tablet mode and desktop mode. Added a new API to expose this API to RN apps.
    • Added is Mouse and Keyboard connected api.
    • Fixes bug #1237

    TODO for future.

    • Add equivalent for ios/android where applicable.
    • Add event hooks where applicable.

    Food for Thought:

    • What is a "Tablet" hardware in the world of Windows?
      • Is a Microsoft Surface (tablet)(2015-2020), actually a "tablet" or more like a hybrid, or something else? Most Windows apps do not look or behave differently in this context.
    • Could/Should a Xbox Consoles or Surface Hub, or Microsoft Surface Table(2012) considered a tablet?
    • Should IsTablet just always be false for windows? And should there be other react-native-device-info API to help better differentiate the devices?

    Compatibility

    | OS | Implemented | | ------- | :---------: | | Windows | ✅ |

    Checklist

    • [X] I have tested this on a device/simulator for each compatible OS
      • I've tested it on a Windows Desktop Computer. I do not have other Windows devices.
    • [x] I added the documentation in README.md
    • [x] I updated the typings files (privateTypes.ts, types.ts)
    • [x] I added a sample use of the API (example/App.js)
    ready-for-review released 
    opened by namrog84 46
  • Compatibility with react-native-firebase

    Compatibility with react-native-firebase

    | Version | 0.21.1 | | Affected OS | Android | | OS Version | 7.0 |

    Hi, I'm trying to use this library and react-native-firebase in my project. But when I try to compile, I get this error

    * What went wrong:
    Execution failed for task ':react-native-device-info:processReleaseResources'.
    > Error: more than one library with package name 'com.google.android.gms.license'
    

    If I uninstall any of the 2, then the other one works.

    Does anyone know how to fix it?

    help wanted android 
    opened by ricardofavero 37
  • method does not override or implement a method from a supertype   @Override

    method does not override or implement a method from a supertype @Override

    i have updated react-native version from 0.44.0 to 0.48.1, after which i am unable to make a build. it is giving this error

    myapp\node_modules\react-native-device-info\android\src\main\java\com\learnium\RNDeviceInfo\RNDeviceInfo.java:26: error: method does not override or implement a method from a supertype
      @Override                                                          
      ^
    1 error                                                              
    :react-native-device-info:compileReleaseJavaWithJavac FAILED         
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':react-native-device-info:compileReleaseJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.
    
    opened by shaharyar123 36
  • ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font

    ERROR: In FontFamilyFont, unable to find attribute android:font

    Bug

    I am getting the following errors: ERROR: In FontFamilyFont, unable to find attribute android:font ERROR: In FontFamilyFont, unable to find attribute android:fontStyle ERROR: In FontFamilyFont, unable to find attribute android:fontVariationSettings ERROR: In FontFamilyFont, unable to find attribute android:fontWeight ERROR: In FontFamilyFont, unable to find attribute android:ttcIndex ERROR: In GradientColor, unable to find attribute android:endX ERROR: In GradientColor, unable to find attribute android:endY ERROR: In GradientColor, unable to find attribute android:startX ERROR: In GradientColor, unable to find attribute android:startY ERROR: In GradientColorItem, unable to find attribute android:offset

    :react-native-device-info:processReleaseResources FAILED

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':react-native-device-info:processReleaseResources'.

    com.android.ide.common.process.ProcessException: Failed to execute aapt

    Environment info

    Environment: OS: Windows 10 Node: 10.13.0 Yarn: 1.12.3 npm: 6.4.1 Watchman: Not Found Xcode: N/A Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338

    Packages: (wanted => installed) react: 16.3.2 => 16.3.2 react-native: 0.55.4 => 0.55.4 React native info output:

    "react-native-device-info": "^0.21.5",
    
    opened by nandini12396 34
  • Ideas for version 3

    Ideas for version 3

    At some point, we are going to have to release a BC breaking version in order to fix some inconsistencies in this library. While we're at it, we might want to rethink the implementation a bit.

    Here are some of my findings after having spending some time triaging issues, reviewing pull requests and reading the source code:

    Return type inconsistency

    Findings:

    • getBuildNumber() returns a string on iOS, and a number on Android (#214). Should be a number IMHO
    • The windows implementation sometimes returns "not available" when a feature is missing
    • Some methods are not implemented at all on a target and causes exceptions when called. Example: getIPAddress()

    Proposal:

    • No method should throw an exception if not implemented.
    • Exception should only be thrown for Android when a permission is missing
    • Unimplemented methods should always return undefined.

    Namespacing

    Findings: The API is getting bigger and deals with a lot of mixed stuff (networking, telephony, calendar, ..).

    Proposal: I think that introducing some king of namespacing could help keeping it tidy:

    DeviceInfo.telephony.getPhoneNumber();
    DeviceInfo.network.getMacAddress();
    DeviceInfo.network.getIPAddress();
    // ...
    

    We would also split the native code files by namespace

    Naming

    Naming is inconsistent: getDeviceName() vs getBrand().

    We should take advantage of namespaces introduction to tidy up names.

    Multi SIM

    Currently, telephony related functions returns data for the first SIM card. Might be good to introduce multi SIM card support.

    Same goes for network informations (#259)


    Feel free to join the conversation and suggest other or better ideas!

    help wanted 
    opened by machour 33
  • RNDeviceInfo.getUniqueId is not a function

    RNDeviceInfo.getUniqueId is not a function

    react-native 0.60.5 react-native-device-info 3.1.1

    this.devUniqueId = await DeviceInfo.getUniqueId(); ---> Possible Unhandled Promise Rejection (id: 0): TypeError: RNDeviceInfo.getUniqueId is not a function

    in 2.3.2 was ok

    cant-reproduce 
    opened by kefyru 32
  • Install / configure CI

    Install / configure CI

    I'd like to have CI configured to provide a bit more comfort with releases.

    I know with Travis at least we can do Node and Android things, but not Mac and Windows, I think that might be the standard.

    Unless someone objects since I am more familiar with Travis I will setup CI with them and have some node images do type checks and bundles on the main repository as well as the example app, and I'll try to have a full react-native + android app build for the example in a separate image

    help wanted stale 
    opened by mikehardy 32
  • Different getUniqueId after version upgrade

    Different getUniqueId after version upgrade

    Summary

    Different getUniqueId after version upgrade

    | Version | ? 3.1.4 -> 8.0.1 | | Affected OS | ? ios |

    Current behavior

    1. Install react-native-device-info v3.1.4
    2. Call getUniqueId -> get old ID (id1)
    3. Upgrade to 8.0.1
    4. Call getUniqueId -> get new ID (id2)
    5. Downgrade to v3.1.4
    6. Call getUniqueId -> get old ID (id1)
    7. Upgrade to 8.0.1
    8. Call getUniqueId -> get new ID (id2)
    9. Call syncUniqueId -> get new ID (id2)
    10. Downgrade to v3.1.4
    11. Call getUniqueId -> get new ID (id2)

    Expected behavior

    Always get the same id

    stale 
    opened by LevanKvirkvelia 31
  • Add constants

    Add constants

    Description

    Partial fix for iOS https://github.com/react-native-community/react-native-device-info/issues/776

    I've added some of the constants again that many people were complaining about not readily available as constants.

    List of properties:

    • uniqueId
    • deviceId
    • bundleId
    • systemName
    • systemVersion
    • appVersion
    • buildNumber
    • isTablet
    • appName

    To Do:

    • Should we remove async / sync calls for properties that are constants again? (I haven't removed them yet waiting for feedback)

    • isTablet was a special one since the naming (getProperty, getPropertySync) wasn't similar to other methods. Depending on what direction you want to go, we could add:

    getIsTablet
    getIsTabletAsync
    

    Compatibility

    | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ❌ | | Windows | ❌ |

    Checklist

    • [-] I have tested this on a device/simulator for each compatible OS
    • [-] I added the documentation in README.md
    • [-] I mentioned this change in CHANGELOG.md
    • [-] I updated the typings files (privateTypes.ts, types.ts)
    • [-] I updated the dummy web/test polyfill (default/index.js)
    • [-] I added a sample use of the API (example/App.js)
    opened by JensDebergh 31
  • feat: add getFontScale()

    feat: add getFontScale()

    It is common to change the layout based on the font size when adapting an app for accessibility setting. This allows developers to fetch the font scale easily so that they can determine if they want to use a layout that looks better with larger texts (change number of columns, amount of padding, etc)

    The font scale attribute is built in to Android, and I adapted it to iOS by using the font size details from https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/

    I am open to changes in the explanation I added in the README, not sure if I put too much detail or anything. Also open to discussing implementation details, though I believe this is a fairly basic change.

    enhancement android ios 
    opened by SteffeyDev 30
  • build(deps): bump json5 from 2.2.0 to 2.2.3 in /example

    build(deps): bump json5 from 2.2.0 to 2.2.3 in /example

    Bumps json5 from 2.2.0 to 2.2.3.

    Release notes

    Sourced from json5's releases.

    v2.2.3

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)
    Changelog

    Sourced from json5's changelog.

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1 [code, diff]

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)
    Commits
    • c3a7524 2.2.3
    • 94fd06d docs: update CHANGELOG for v2.2.3
    • 3b8cebf docs(security): use GitHub security advisories
    • f0fd9e1 docs: publish a security policy
    • 6a91a05 docs(template): bug -> bug report
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies javascript 
    opened by dependabot[bot] 0
  • Unablle to get Device Info in release mode android

    Unablle to get Device Info in release mode android

    Hi, first of all, thanks for creating a such wonderful library. It's awesome. and very easy to use.

    I have added this to my one of projects and it's working fine in debug mode. but I am facing one issue when I am creating a release build. I am not getting any info on the device using this. This means it's not working in release mode.

    Please help me with this.

    code snip:

    
    import DeviceInfo from 'react-native-device-info';
    
      const deInfo = {
          brand: DeviceInfo.getBrand(),
          sysVersion: DeviceInfo.getSystemVersion(),
          modal: DeviceInfo.getModel(),
          version: DeviceInfo.getVersion(),
        };
        console.log({deInfo});
    
    

    details: "react": "17.0.2", "react-native": "0.68.2", "react-native-device-info": "^8.4.1",

    Thanks

    Summary

    | | | | ----------- | --- | | Version | 8.4.1 | | Affected OS | android | | OS Version | android 9,10,11,12,13 |

    Current behavior

    Expected behavior

    opened by rahuldev761 0
  • build(deps): bump json5 from 2.1.3 to 2.2.3

    build(deps): bump json5 from 2.1.3 to 2.2.3

    Bumps json5 from 2.1.3 to 2.2.3.

    Release notes

    Sourced from json5's releases.

    v2.2.3

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)
    Changelog

    Sourced from json5's changelog.

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1 [code, diff]

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0 [code, diff]

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)
    Commits
    • c3a7524 2.2.3
    • 94fd06d docs: update CHANGELOG for v2.2.3
    • 3b8cebf docs(security): use GitHub security advisories
    • f0fd9e1 docs: publish a security policy
    • 6a91a05 docs(template): bug -> bug report
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies javascript 
    opened by dependabot[bot] 0
  • feat: add DisplayZoomed ios

    feat: add DisplayZoomed ios

    add feat to check if the app has the zoomed feature enabled only for ios

    Description

    Fixes #1485

    Added isDisplayZoomed() that allows to check if the user has enabled the zoomed feature from IOS

    Compatibility

    | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ❌ | | Windows | ❌ |

    Checklist

    • [x] I have tested this on a device/simulator for each compatible OS
    • [x] I added the documentation in README.md
    • [x] I updated the typings files (privateTypes.ts, types.ts)
    • [x] I added a sample use of the API (example/App.js)
    opened by eddyriv3ra 0
  • hi ,i am getting 'unknown' for getPhoneNumber(),please give any suggestions /resolutions if any

    hi ,i am getting 'unknown' for getPhoneNumber(),please give any suggestions /resolutions if any

    Summary

    | | | | ----------- | --- | | Version | ? | | Affected OS | ? | | OS Version | ? |

    Current behavior

    Expected behavior

    opened by geeta87 0
  • getting `JavaScript execution returned a result of an unsupported type` error

    getting `JavaScript execution returned a result of an unsupported type` error

    Summary

    It appears that only for ios sporadically when we call getUserAgent we get an error JavaScript execution returned a result of an unsupported type for ios only (we had about 30 errors in the last 90 days) I know that this is relatively old version in compare to what you currently have but when looking at the implementation it appears that this function was not changed | | | | ----------- | --- | | Version | 8.4.8 | | Affected OS | iOS | | OS Version | 13.3.1 - 16.1 |

    opened by OrLevy23 0
Releases(v10.3.0)
Owner
null
Detects device type on both android and ios

React Native Device Specs RNDeviceSpecs detects the specifications of the device it is running on. Requiring or importing the module will give you an

Fixt 11 May 10, 2017
iOS device motion wrapper for React Native.

react-native-device-motion iOS device motion wrapper for React Native. Uses iOS CMMotionManager to provide device motion updates like roll, pitch, yaw

Param Aggarwal 33 Sep 24, 2022
plugin for react native that adds an listener for the battery status of a device

react-native-battery A cross-platform React Native module that returns the battery level/status of a device. Supports iOS and Android. Package Install

Olajide Ogundipe Jr 48 Nov 23, 2022
React Native - Device Angles

React Native - Device Angles Get rotation information (pitch, yaw, roll) - ios Getting started $ npm install react-native-device-angles --save or $ ya

Cristian Szwarc 14 Nov 29, 2021
Monitor device battery state changes

react-native-device-battery Get and observe the devices battery level and charging status Installation Install the node module npm install react-nativ

Robin 41 Jul 8, 2021
Alarm clock functionality for react native ios and android using react-native-push-notification and react-native-community/async-storage

react-native-simple-alarm Alarm clock functionality for react native ios and android built using react-native-push-notification and react-native-commu

Jordan Daniels 74 Jan 6, 2023
React Native plug-in that provides GPS location information

react-native-location Native GPS location support for React Native. You might decide to use this library over the built-in geolocation because it incl

Tim Park 839 Dec 26, 2022
React Native module bridge to obtain information about the user’s home cellular service provider,

React Native Carrier Info React Native module bridge to obtain information about the user’s home cellular service provider. Makes use of the following

React Native WebRTC 79 Jun 12, 2022
Creating secure routes and saving user information in SecureStore

React Native, sistema de login social nativo usando uma conta do Google Primeiro passo clonar o repositório git clone [email protected]:r-santtos/Stu

Ricardo Santos 1 Dec 11, 2021
A library for React-Native to help you download large files on iOS and Android both in the foreground and most importantly in the background.

react-native-background-downloader A library for React-Native to help you download large files on iOS and Android both in the foreground and most impo

Eko Labs 271 Dec 27, 2022
React Native ssl pinning and cookies handling based on okhttp3 on (Android). and AFNetworking on (iOS)

react-native-ssl-pinning React-Native ssl pinning & public key pinning using OkHttp 3 in Android, and AFNetworking on iOS. NOTES: for RN 0.60.0 or lat

Maxim Toyberman 260 Dec 19, 2022
An unified permissions API for React Native on iOS and Android

☝?? react-native-permissions A unified permissions API for React Native on iOS, Android and Windows. (For Windows only builds 18362 and later are supp

Mathieu Acthernoene 3.4k Jan 8, 2023
React native package to add in app review functionality for android and ios applications

react-native-in-app-review Now you can integrate this to react native and in-app review dialog can be shown to user. User doesn't need to move to play

Ravi Rupareliya 74 Nov 2, 2022
A cordova battery status listener for react-native, support for ios and android

React Native BatteryStatus (remobile) A cordova battery status listener for react-native, support for ios and android Installation npm install @remobi

YunJiang.Fang 14 Jan 28, 2020
Event Source implementation for React Native. Server-Sent Events (SSE) for iOS and Android 🚀

React Native EventSource (Server-Sent Events) ?? Your missing EventSource implementation for React Native! React-Native-SSE library supports TypeScrip

Binaryminds 52 Dec 16, 2022
React native geolocation service for iOS and android

React native geolocation service for iOS and android

Iftekhar Rifat 1.4k Jan 6, 2023
iOS CallKit framework and Android ConnectionService for React Native

iOS CallKit framework and Android ConnectionService for React Native

React Native WebRTC 736 Dec 29, 2022
React Native library for PSPDFKit for iOS, Android and Windows UWP.

React Native Library for PSPDFKit for iOS, Android & Windows UWP. (PDF SDK for React Native) This library requires a valid license of PSPDFKit. Licens

PSPDFKit GmbH 120 Dec 14, 2022
Fully customizable, easy to use checkbox with flexible component by React Native on Android and iOS

Installation Add the dependency: npm i react-native-checkbox-flex Peer Dependencies IMPORTANT! You need install them "@freakycoder/react-native-bounce

FreakyCoder 11 Nov 20, 2021