Commit dbbe53f2 authored by Gant Laborde's avatar Gant Laborde Committed by GitHub

Merge pull request #238 from jkimbo/readme-types

Update method table with return types
parents ab05398f 0911ad10
...@@ -166,33 +166,33 @@ var DeviceInfo = require('react-native-device-info'); ...@@ -166,33 +166,33 @@ var DeviceInfo = require('react-native-device-info');
| Name | Method | Return | Notes | | 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 Unique ID | `getUniqueID()` | `string` e.g. "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 Manufacturer | `getManufacturer()` | `string` e.g. "Apple" | |
| Device Brand | `getBrand()` | Apple / htc / Xiaomi | | | Device Brand | `getBrand()` | `string` e.g. "Apple / htc / Xiaomi" | |
| Device Model | `getModel()` | iPhone 6 | | | Device Model | `getModel()` | `string` e.g. "iPhone 6" | |
| Device ID | `getDeviceId()` | iPhone7,2 | Or the board on Android e.g. goldfish | | Device ID | `getDeviceId()` | `string` e.g. "iPhone7,2" | Or the board on Android e.g. goldfish |
| System Name | `getSystemName()` | iPhone OS | | | System Name | `getSystemName()` | `string` e.g. "iPhone OS" | |
| System Version | `getSystemVersion()` | 9.0 | | | System Version | `getSystemVersion()` | `string` e.g. "9.0" | |
| API Level | `getAPILevel()` | 25 | ANDROID ONLY - see [API Levels](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)| | Bundle ID | `getBundleId()` | `string` e.g. "com.learnium.mobile" | |
| Bundle ID | `getBundleId()` | com.learnium.mobile | | | Build Number | `getBuildNumber()` | `string` e.g. "89" | |
| Build Number | `getBuildNumber()` | 89 | | | App Version | `getVersion()` | `string` e.g. "1.1.0" | |
| App Version | `getVersion()` | 1.1.0 | | | App Version (Readable) | `getReadableVersion()` | `string` e.g. "1.1.0.89" | |
| App Version (Readable) | `getReadableVersion()` | 1.1.0.89 | | | Device Name | `getDeviceName()` | `string` e.g. "Becca's iPhone 6" | |
| Device Name | `getDeviceName()` | Becca's iPhone 6 | | | User Agent | `getUserAgent()` | `string` e.g. "Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D)" | |
| 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()` | `string` e.g. "en-US" | |
| Device Locale | `getDeviceLocale()` | en-US | | | Device Country | `getDeviceCountry()` | `string` e.g. "US" | |
| Device Country | `getDeviceCountry()` | US | | | Timezone | `getTimezone()` | `string` e.g. "America/Mexico_City" | |
| Timezone | `getTimezone()` | America/Mexico_City | | | App is running in emulator | `isEmulator()` | `boolean` e.g. true | if app is running in emulator return true |
| App Instance ID | `getInstanceID()` | | ANDROID ONLY - see https://developers.google.com/instance-id/ | | App is running on a tablet | `isTablet()` | `boolean` e.g. true | if app is running on a tablet return true |
| App is running in emulator | `isEmulator()` | true | if app is running in emulator return true | | PIN or fingerprint set | `isPinOrFingerprintSet()` | `(callback: (isPinOrFingerprintSet: boolean) => void) => void` | Only supported in Android and iOS 9.0 and above |
| App is running on a tablet | `isTablet()` | true | if app is running on a tablet return true | | API Level | `getAPILevel()` | `number` e.g. 25 | ANDROID ONLY - see [API Levels](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)|
| PIN or fingerprint set | `isPinOrFingerprintSet()(callback)`| | Only supported in Android and iOS 9.0 and above | | App Instance ID | `getInstanceID()` | `string` | ANDROID ONLY - see https://developers.google.com/instance-id/ |
| Phone Number | `getPhoneNumber()` | "2348675309" or "" or null | Only supported in Android | | Phone Number | `getPhoneNumber()` | `?string` e.g. "2348675309" or "" | Only supported in Android |
| First Install Time | `getFirstInstallTime()` | 1505607068808 | Only supported in Android | | First Install Time | `getFirstInstallTime()` | `number` e.g. 1505607068808 | Only supported in Android |
| Last Install Time | `getLastUpdateTime()` | 1505607068808 | Only supported in Android | | Last Install Time | `getLastUpdateTime()` | `number` e.g. 1505607068808 | Only supported in Android |
| Serial Number | `getSerialNumber()` | | Only supported in Android | Serial Number | `getSerialNumber()` | `string` | Only supported in Android
| IP Address | `getIPAddress()` | | Only supported in Android | IP Address | `getIPAddress()` | `Promise<string>` | Only supported in Android
| MAC Address | `getMACAddress()` | | Only supported in Android | MAC Address | `getMACAddress()` | `Promise<string>` | Only supported in Android
Since the device setting for PIN/Fingerprint can be modified while the app is still open, this is available via callback instead of as a constant. To use, pass a callback function to the returned bridge function in your javascript: Since the device setting for PIN/Fingerprint can be modified while the app is still open, this is available via callback instead of as a constant. To use, pass a callback function to the returned bridge function in your javascript:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment