is there no way to read serial number using expo. I should be able to read using external packages like react-native-device-info but I can’t do this without expo? because when i install this package i get this and similar errors
react-native-device-info is not compatible with Expo Go client app.
Expo SDK has a library called
expo-device: Device - Expo Documentation that works with Expo Go client when developing projects. I don’t think you can read the serial number because there might not be an API method for that. Also, reading a serial number from
react-native-device-info only works for Android if the app has the privilege to access that info (I’m not unsure what your use case is about reading serial numbers).
If you are still want to use
react-native-device-info, you can use Expo Dev Client: Getting Started - Expo Documentation
Also, a good way to check if there is a package compatible with Expo Go app is to search for it on https://reactnative.directory/?search=react-native-device-info
Hey @amanhimself ,
First of all thank you for the reply. All devices using the application will be android, this is certain for us. Our purpose of trying to read the serial number is to try to find out which device opened it from within the application. I looked at the parts about expo-device. As you said, there is no function to read the serial number. I just want to understand if there is a way to do this using expo. But I guess that doesn’t seem possible
If you want to track events against a single install of the app, you may have an easier time generating a unique identifier (with a package like
uuid) on first app load and saving that to local storage using
react-native-async-storage. This is similar to what analytics packages do (since they would not have access to serial number), requires no additional permissions, and works with Expo Go. As mentioned above,
react-native-device-info can be used, as long as you use a custom dev client for development instead of Expo Go. There is nothing preventing you from building an app with EAS Build using that package.