Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-device-info
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
放牛的园子
react-native-device-info
Commits
96965f14
Commit
96965f14
authored
Mar 08, 2017
by
Gant Laborde
Committed by
GitHub
Mar 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #133 from joshuapinter/patch-2
Use table to show various methods and returns.
parents
db3a419f
d63a860a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
38 deletions
+22
-38
README.md
README.md
+22
-38
No files found.
README.md
View file @
96965f14
...
...
@@ -159,43 +159,27 @@ See [CHANGELOG.md](https://github.com/rebeccahughes/react-native-device-info/blo
```js
var DeviceInfo = require('react-native-device-info');
// or import DeviceInfo from '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 Brand", DeviceInfo.getBrand()); // e.g. Apple / htc / Xiaomi
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("System Name", DeviceInfo.getSystemName()); // e.g. iPhone OS
console.log("System 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
console.log("Timezone", DeviceInfo.getTimezone()); // e.g America/Mexico_City
console.log("App Instance ID", DeviceInfo.getInstanceID()); // ANDROID ONLY - see https://developers.google.com/instance-id/
console.log("App is running in emulator", DeviceInfo.isEmulator()); // if app is running in emulator return true
| Name | Method | Return | Notes |
| :------------------------- | :--------------------- | :-------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- |
| Device Unique ID | `
getUniqueID()
` | FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9 | This is IDFV on iOS so it will change if all apps from the current apps vendor have been previously uninstalled. |
| Device Manufacturer | `
getManufacturer()
` | Apple | |
| Device Brand | `
getBrand()
` | Apple / htc / Xiaomi | |
| Device Model | `
getModel()
` | iPhone 6 | |
| Device ID | `
getDeviceId()
` | iPhone7,2 | Or the board on Android e.g. goldfish |
| System Name | `
getSystemName()
` | iPhone OS | |
| System Version | `
getSystemVersion()
` | 9.0 | |
| Bundle ID | `
getBundleId()
` | com.learnium.mobile | |
| Build Number | `
getBuildNumber()
` | 89 | |
| App Version | `
getVersion()
` | 1.1.0 | |
| App Version (Readable) | `
getReadableVersion()
` | 1.1.0.89 | |
| Device Name | `
getDeviceName()
` | Becca's iPhone 6 | |
| User Agent | `
getUserAgent()
` | Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D) | |
| Device Locale | `
getDeviceLocale()
` | en-US | |
| Device Country | `
getDeviceCountry()
` | US | |
| Timezone | `
getTimezone()
` | America/Mexico_City | |
| App Instance ID | `
getInstanceID()
` | | ANDROID ONLY - see https://developers.google.com/instance-id/ |
| App is running in emulator | `
isEmulator()
` | true | if app is running in emulator return true |
| App is running on a tablet | `
isTablet()
`
| true | if app is running on a tablet return true |
console.log("App is running on a tablet", DeviceInfo.isTablet()); // if app is running on a tablet return true
``
`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment