Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Unable to fetch IMEI number of a mobile device using React-Native

$
0
0

I have type-script code for a mobile app. I want to fetch the IMEI code of the device when I log into the app. I have linked react-native-imei (android) library with react-native successfully, but when I add following code at login, I do not get the number:const IMEIObj = require('react-native-imei');

IMEIObj.getImei().then((imeiList: any) => {    console.log("imei", imeiList); // prints ["AABBBBBBCCCCCCD"]}) 

Instead I get the following error:TypeError: null is not an object (evaluating 'ReactNative.NativeModules.IMEI.getImei')

I have been on this for 2 days, but couldn't move ahead. Can you please help me here? Thanks.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>