Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
react-native-device-info-ksi
Advanced tools
Unfortunately, I don't have the time to continue maintaining this module. If you would like to take over, please open an issue or get in touch with me (@rebeccahughes).
Device Information for react-native
First you need to install react-native-device-info:
npm install react-native-device-info --save
Add the following line to your build targets in your Podfile
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
Then run pod install
In XCode, in the project navigator:
In XCode, in the project navigator, select your project.
Run your project (Cmd+R)
(Thanks to @brysgo for writing the instructions)
Run react-native link react-native-device-info
in your project root.
On React Native 0.18+:
import com.learnium.RNDeviceInfo.RNDeviceInfo; // <--- import
public class MainActivity extends ReactActivity {
......
/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new RNDeviceInfo(), // <------ add here
new MainReactPackage());
}
}
(Thanks to @chirag04 for writing the instructions)
...
<uses-permission android:name="android.permission.BLUETOOTH"/>
var DeviceInfo = require('react-native-device-info');
console.log("Device Unique ID", DeviceInfo.getUniqueID()); // e.g. FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9
// * note this is IDFV on iOS so it will change if all apps from the current apps vendor have been previously uninstalled
console.log("Device Manufacturer", DeviceInfo.getManufacturer()); // e.g. Apple
console.log("Device Model", DeviceInfo.getModel()); // e.g. iPhone 6
console.log("Device ID", DeviceInfo.getDeviceId()); // e.g. iPhone7,2 / or the board on Android e.g. goldfish
console.log("Device Name", DeviceInfo.getSystemName()); // e.g. iPhone OS
console.log("Device Version", DeviceInfo.getSystemVersion()); // e.g. 9.0
console.log("Bundle Id", DeviceInfo.getBundleId()); // e.g. com.learnium.mobile
console.log("Build Number", DeviceInfo.getBuildNumber()); // e.g. 89
console.log("App Version", DeviceInfo.getVersion()); // e.g. 1.1.0
console.log("App Version (Readable)", DeviceInfo.getReadableVersion()); // e.g. 1.1.0.89
console.log("Device Name", DeviceInfo.getDeviceName()); // e.g. Becca's iPhone 6
console.log("User Agent", DeviceInfo.getUserAgent()); // e.g. Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D)
console.log("Device Locale", DeviceInfo.getDeviceLocale()); // e.g en-US
console.log("Device Country", DeviceInfo.getDeviceCountry()); // e.g US
FAQs
Get device information using react-native
We found that react-native-device-info-ksi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.