How to read Mobile Hardware and Operating system Details in React Native

Steps to read Mobile Hardware and Operating system Details in React Native

To get the android and ios device information like UDID, version, build, operating system etc – We can get this information by using react-native-device-info plugin provided by react native.
Installation:

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

Usage:

import DeviceInfo from 'react-native-device-info';         
render(){
return( 
<View>                                                      
this.state.error ? 
	<Text>Error: {this.state.error}</Text> : null}                                                 
	<Text>Device Unique ID : { DeviceInfo.getUniqueID() }</Text>
	<Text>Device Manufacturer : { DeviceInfo.getManufacturer() }</Text>
	<Text>Device Model : { DeviceInfo.getModel() }</Text>
	<Text>Device Name : { DeviceInfo.getSystemName() }</Text>
	<Text>Device Version : { DeviceInfo.getSystemVersion() }</Text>
	<Text>Bundle Id : { DeviceInfo.getBundleId() }</Text>
	<Text>Build Number : { DeviceInfo.getBuildNumber() }</Text>
	<Text>App Version : { DeviceInfo.getVersion() }</Text>
	<Text>App Version (Readable) : { DeviceInfo.getReadableVersion() }</Text>
</View>
);
}

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *