React & React Native
리액트네이티브 디바이스 정보 출력 react-native-device-info
클라인STR
2018. 10. 11. 20:55
react-native-device-info ReactNative에서 디바이스에 정보를 출력하는 네이티브 라이브러리 이다.
[Installation]
npm install --save react-native-device-info
[Linking]
react-native link react-native-device-info
react-native-device-info를 사용하여 디바이스 정보를 출력해보자
import DeviceInfo from 'react-native-device-info';
_DeviceInfo() {
console.log("DeviceInfo.getApplicationName : "+DeviceInfo.getApplicationName());
console.log("DeviceInfo.getBrand : "+DeviceInfo.getBrand());
console.log("DeviceInfo.getBrand : "+DeviceInfo.getBrand());
console.log("DeviceInfo.getBuildNumber : "+DeviceInfo.getBuildNumber());
console.log("DeviceInfo.getDeviceCountry : "+ DeviceInfo.getDeviceCountry());
console.log("getDeviceLocale : "+DeviceInfo.getDeviceLocale());
}
더 자세한 내용은 https://github.com/rebeccahughes/react-native-device-info 참고하자