I am implementing API to connect app with server. I have to use deviceId there. As mentioned in here we can use third party library 'react-native-device-info'. But when I am using it I am getting errors as attached screenshots. As per error it's saying to do linking but as I am using react version 0.62, so autolinking is there. So What can be issue? It took too much time to search it but till now I didn't get a proper solution.
How to get device Id in expo react native app
10.2k Views Asked by Piyush Naredi At
2
There are 2 best solutions below
0
visitsb
On
You can use react-native-device-info even in Expo projects. You need to replace Expo Go with a custom build that has react-native-device-info library baked in.
By default, Expo Go used on Android, iPhone Emulators implies managed workflow (aka only expo-* modules are being used). However, using any pure react-native-* libraries falls under bare workflow, so you cannot use Expo Go - the error you see is from Expo Go, not your app.
- Build your custom Expo app with
expo-dev-client,react-native-device-infolibraries included, and install that on your emulators. This needs to be done once when you add areact-native-*library. - Now continue to add code to your project that uses features from
react-native-device-info. npx expo start --dev-clientand choose your emulator. Your custom build will be launched and you can make live changes as always like in Expo Go.
Do check out the section on Development Builds from Expo. Needless to say, I have successfully used react-native-device-info on my Expo project, because expo-device cannot provide what I needed.
Related Questions in REACT-NATIVE
- React Native: detect if UIVisualEffectView is supported
- Prevent Chrome debugger from stealing focus in React Native
- React-native upload image to amazons s3
- react-native update NavigatorIOS component's props
- promise – can't find variable process
- Using React Native within existing iOS app for some views only
- What is a good approach to building and distributing a React Native iOS component that extends iOS functionality?
- error in xcode 6 "is not registered as a URL scheme. Please add it in your Info.plist"
- DeviceEventEmitter stops emitting events to application when screen locked
- How to rename react-native entry file (index.ios.js)
- react-native component lifecycle methods not firing on navigation
- How to use comments in React
- react-native propagate changes in props through ListView and Navigator
- How do i use the iOS shake gesture with react native?
- TouchableHighlight won't accept press events while keyboard is open
Related Questions in EXPO
- How can I determine if a video has just finished using expo.video? ReactNative/Expo.io
- Unknown named Module, using component will receive props to update an image
- Video is still playing when i navigate to another layout
- Error running adb: Error running app. Error: Activity not started, unable to resolve Intent
- Video playlist issue (when one video ends, the next video plays beginning from the length of previous vid) Expo/React Native
- Why is my function being called infinitely? (react-native/expo)
- Are silent Expo push-notifications possible?
- Change navigation bar color
- Set up different language for iOS app using react-native and expo
- Using Animated.Flatlist and Animated.ScrollView to animate an Animated.View is not smooth
- React Native + Firebase + Expo versions love triangle issues
- React Native Expo Camera
- Clear Previous Expo Push Notifications
- How to authorize users across the react-navigation app?
- react-navigation: Navigate to same RouteName but with different params
Related Questions in HYBRID-MOBILE-APP
- Why my javamail program not running through jdeveloper?
- Visual Studio, Ripple Emulator and CORS/Cross Domain Ajax
- How to use ionicModal Methods?
- How to create a simple checkout flow for mobile app and update it in the mysql database?
- What causes some iOS web pages to not continue scrolling when swiping finger is released?
- How to post MAF form data to Rest service in Json format?
- How to add Sencha Touch to Visual Studio 2013 Apache Cordova App?
- Windows Phone 8 App Development using Phonegap
- SignalR working in browser not in app
- Phonegap: ./create error
- IBM MobileFirst 7.0 - How do we generate .ipa file?
- How to get parameters from a url and use it in HTML?
- Ionic toggle checkboxes with 2 colors
- Inconsistent behaviour of SAPUI5 app on Android Lollipop (5.0)
- Best option for converting a JSP website to Android app?
Related Questions in DEVICEID
- Gear VR - You are not a developer
- Different Android Id in Android 10
- How to get Device Unique Id in ReactJs
- Using a number of devices to send data to a single API endpoint
- Dummy FCM Tokens
- iOS: Is it in any way possible to keep the device id after uninstalling app?
- How to use device.uuid of Cordova library on sapui5 application?
- I am trying to extract the device ID which is unique for each and every device for react-native using expo,but showing error log
- How to determine device ID for AMD Ryzen 5 2600 CPU
- Flutter android device id issue
- How to identify a user login from a new device
- How to get device Id in expo react native app
- Setting new instance with existing boot disk as previous ran out of memory
- Permanent device ID between Nearby Connections?
- Powershell. Why where {} directive can not find two matching DeviceID? One taken from Win32_VideoController, another from Regedit value
Related Questions in REACT-NATIVE-DEVICE-INFO
- Does anyone know how to get the IMEI number of device in React Native using EXPO?
- React native android app crashes in assemble release build when use react-native-device-info module
- Invariant Violation: Module JSTimers is not a registered callable module(calling callTimers).Issue due to device-info package in lerna setup
- How to get device Id in expo react native app
- How can I get list of apps, images and videos of my device in react native?
- How to auto-detect phone numbers of the user in react-native?
- Execution failed for task ':compileDebugJavaWithJavac' while trying to build Android App
- Manifest merger failed. After adding and linking react-native-device-info
- Can I get some sample output from react-native-device-info?
- Adding React Native module doesn't add line to Podfile, but `pod install` installs it anyway
- React Native Android App Build failed in appcenter.ms
- How can we get other apps' screen time in react native? Is there any library or package available in react native?
- Unable to return IP address using react-native-device-info's getIPAddress()
- React Native force component refresh when the app goes to foreground
- How to resolve React Native Firebase Error (messaging().getToken()), related to react-native-device-info
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

react-native-device-info library wont work in Expo , since it requires linking of native modules hence the error.It will only work in pure react native apps.
You can check this by expo itself : expo-device
hopeit helps.feel free for doubts