BJ Coder
BJ Coder

Reputation: 402

react-native-device-info get getUniqueID() not working with react native and expo in android

I am trying to get device info & get referral code for referring and earn program for a mobile app with React Native & Expo.

Check my step 1. Install npm by using

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

2. Linking with

react-native link react-native-device-info

3. Using

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

const deviceName = DeviceInfo.getUniqueID();

I am getting an error of

undefined is not an object (evaluating 'RNDeviceInfo.uniqueId')

Upvotes: 3

Views: 1668

Answers (1)

Mitesh Agile
Mitesh Agile

Reputation: 11

use getUniqueId instead of getUniqueID

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

const deviceName = DeviceInfo.getUniqueId();

Upvotes: 1

Related Questions