JSPM

react-native-imei

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 204
  • Score
    100M100P100Q85725F

Get IMEI in react-native (Android only)

Package Exports

  • react-native-imei

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-imei) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-native-imei

A react native library for Android, will return IMEI (International Mobile Equipment Identity) when app is being run on an Android device and has READ_PHONE_STATE permission.

IMEI is guaranteed to be non-empty string, otherwise you will get an exception.

Exception is thrown if:

  • Permission is missing
  • Fails to get non-empty imei
  • Device is not Android device

Installation

npm install react-native-imei --save

# or with yarn
yarn add react-native-imei

# Remember to link after install!
react-native link react-native-imei

Examples

// JavaScript
const IMEI = require('react-native-imei');
IMEI.getImei().then(imeiList => {
    console.log(imeiList)
});

Google Play

Google Play has fairly strict rules regarding the use of hardware identifiers such as IMEI numbers. Make sure your use of this library is compliant with current policies if you plan to distribute your Android app using Google Play.

iOS

This library does not support iOS devices. Apple does not allow apps to access device identiying information such as IMEI. For more information please look at this StackOverflow question.