react-native-device-info
Advanced tools
Comparing version 0.11.0 to 0.12.0
## Release Notes | ||
### Upcoming | ||
### 0.12.0 | ||
- Get real WebView UserAgent on Android (https://github.com/rebeccahughes/react-native-device-info/pull/207) | ||
- Add DeviceUID.h to public headers (https://github.com/rebeccahughes/react-native-device-info/pull/217) | ||
- Add `getPhoneNumber` (https://github.com/rebeccahughes/react-native-device-info/pull/174) | ||
- Fix typescript definitions (https://github.com/rebeccahughes/react-native-device-info/pull/221) | ||
- Add `getFirstInstallTime` and `getLastInstallTime` (https://github.com/rebeccahughes/react-native-device-info/pull/222) | ||
- Added version check and permission to work with Android API >= 16 (https://github.com/rebeccahughes/react-native-device-info/pull/225) | ||
- Added device detection even when in an iOS emulator (https://github.com/rebeccahughes/react-native-device-info/pull/224) | ||
- Add support for new iPhone, iPad, and Apple TV models (https://github.com/rebeccahughes/react-native-device-info/pull/230) | ||
- Add android only `getAPILevel` method (https://github.com/rebeccahughes/react-native-device-info/pull/232) | ||
- Add Android support for serial number, IP, and MAC address (https://github.com/rebeccahughes/react-native-device-info/pull/150) | ||
- Add tvOS support (https://github.com/rebeccahughes/react-native-device-info/pull/235) | ||
- Add flow types | ||
- Fix getCurrentActivity() null crash in Android (https://github.com/rebeccahughes/react-native-device-info/pull/247) | ||
[Diff](https://github.com/rebeccahughes/react-native-device-info/compare/1aafc6f0b20d7cd6f0939ea5370e9899e4914c93...master) | ||
### 0.11.0 | ||
- Add support for RN > 0.47 | ||
- Update typescript definitions | ||
[Diff](https://github.com/rebeccahughes/react-native-device-info/compare/5b869cdd5e16b65cbe4e85a565aa331bd7546b89...1aafc6f0b20d7cd6f0939ea5370e9899e4914c93) | ||
### 0.10.2 | ||
- Add typescript definitions | ||
[Diff](https://github.com/rebeccahughes/react-native-device-info/compare/f3967862711892615e7f51d49d0034ee134f3e3d...5b869cdd5e16b65cbe4e85a565aa331bd7546b89) | ||
### 0.10.1 | ||
- Add `isPinOrFingerprintSet` method | ||
- Add support for RN > 0.40 | ||
[Diff](https://github.com/rebeccahughes/react-native-device-info/compare/c843144ea872a79f4d53a53b32f72511fbfc8d8b...f3967862711892615e7f51d49d0034ee134f3e3d) | ||
### 0.10.0 | ||
- Semver fix | ||
[Diff](https://github.com/rebeccahughes/react-native-device-info/compare/e8bfe5ea8d5f5414f2f97f35a5d02b611cbe39e3...c843144ea872a79f4d53a53b32f72511fbfc8d8b) | ||
### 0.9.8 | ||
[Diff](https://github.com/rebeccahughes/react-native-device-info/compare/668996c64e23f477fc8156cdc43a49198b4fdd20...e8bfe5ea8d5f5414f2f97f35a5d02b611cbe39e3) | ||
### 0.9.7 | ||
@@ -7,3 +57,3 @@ | ||
### 0.9.3 | ||
### 0.9.3 | ||
@@ -10,0 +60,0 @@ adds support for Brand information e.g. apple, htc, etc |
// should be imported this way: | ||
// import DeviceInfo from 'react-native-device-info'; | ||
// import * as DeviceInfo from 'react-native-device-info'; | ||
declare class DeviceInfo { | ||
public static getUniqueID(): string; | ||
public static getManufacturer(): string; | ||
public static getBrand(): string; | ||
public static getModel(): string; | ||
public static getDeviceId(): string; | ||
public static getSystemName(): string; | ||
public static getSystemVersion(): string; | ||
public static getBundleId(): string; | ||
public static getBuildNumber(): string; | ||
public static getVersion(): string; | ||
public static getReadableVersion(): string; | ||
public static getDeviceName(): string; | ||
public static getUserAgent(): string; | ||
public static getDeviceLocale(): string; | ||
public static getDeviceCountry(): string; | ||
public static getTimezone(): string; | ||
public static getInstanceID(): string; | ||
public static isEmulator(): boolean; | ||
public static isTablet(): boolean; | ||
public static isPinOrFingerprintSet(cb: (isSet: boolean) => void): void; | ||
} | ||
export default DeviceInfo; | ||
export function getUniqueID(): string; | ||
export function getManufacturer(): string; | ||
export function getBrand(): string; | ||
export function getModel(): string; | ||
export function getDeviceId(): string; | ||
export function getSystemName(): string; | ||
export function getSystemVersion(): string; | ||
export function getBundleId(): string; | ||
export function getBuildNumber(): string; | ||
export function getVersion(): string; | ||
export function getReadableVersion(): string; | ||
export function getDeviceName(): string; | ||
export function getUserAgent(): string; | ||
export function getDeviceLocale(): string; | ||
export function getDeviceCountry(): string; | ||
export function getTimezone(): string; | ||
export function getInstanceID(): string; | ||
export function isEmulator(): boolean; | ||
export function isTablet(): boolean; | ||
export function isPinOrFingerprintSet(): (cb: (isPinOrFingerprintSet: boolean) => void) => void; | ||
export function getFirstInstallTime(): number; | ||
export function getLastUpdateTime(): number; | ||
export function getSerialNumber(): string; | ||
export function getIPAddress(): Promise<string>; | ||
export function getMACAddress(): Promise<string>; |
@@ -14,2 +14,11 @@ /** | ||
}, | ||
getSerialNumber: function () { | ||
return RNDeviceInfo.serialNumber; | ||
}, | ||
getIPAddress: function () { | ||
return RNDeviceInfo.getIpAddress(); | ||
}, | ||
getMACAddress: function () { | ||
return RNDeviceInfo.getMacAddress(); | ||
}, | ||
getDeviceId: function () { | ||
@@ -33,2 +42,5 @@ return RNDeviceInfo.deviceId; | ||
}, | ||
getAPILevel: function () { | ||
return RNDeviceInfo.apiLevel; | ||
}, | ||
getBundleId: function() { | ||
@@ -70,2 +82,11 @@ return RNDeviceInfo.bundleId; | ||
}, | ||
getFirstInstallTime: function () { | ||
return RNDeviceInfo.firstInstallTime; | ||
}, | ||
getLastUpdateTime: function () { | ||
return RNDeviceInfo.lastUpdateTime; | ||
}, | ||
getPhoneNumber: function () { | ||
return RNDeviceInfo.phoneNumber; | ||
} | ||
}; |
{ | ||
"name": "react-native-device-info", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Get device information using react-native", | ||
@@ -11,2 +11,5 @@ "main": "deviceinfo.js", | ||
}, | ||
"scripts": { | ||
"shipit": "np" | ||
}, | ||
"keywords": [ | ||
@@ -23,8 +26,13 @@ "react-component", | ||
"author": "Rebecca Hughes <rebecca@learnium.net> (https://github.com/rebeccahughes)", | ||
"contributors": [{ | ||
"name": "Gant Laborde", | ||
"email": "gant@infinite.red", | ||
"url": "https://github.com/gantman" | ||
}], | ||
"license": "MIT" | ||
"contributors": [ | ||
{ | ||
"name": "Gant Laborde", | ||
"email": "gant@infinite.red", | ||
"url": "https://github.com/gantman" | ||
} | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"np": "^2.16.0" | ||
} | ||
} |
@@ -146,9 +146,10 @@ # react-native-device-info | ||
## Device Name | ||
## Permissions | ||
If you want to get the device name in Android add this to your `AndroidManifest.xml` (optional): | ||
Add the appropriate, optional permissions to your `AndroidManifest.xml`: | ||
```xml | ||
... | ||
<uses-permission android:name="android.permission.BLUETOOTH"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH"/> <!-- for Device Name --> | ||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> <!-- for Phone Number --> | ||
``` | ||
@@ -167,29 +168,36 @@ | ||
| 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 | | ||
| PIN or fingerprint set | `isPinOrFingerprintSet(callback)`| | Only supported in Android and iOS 9.0 and above | ||
| Name | Method | Return | Notes | | ||
| :------------------------- | :------------------------------- | :-------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- | | ||
| 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()` | `string` e.g. "Apple" | | | ||
| Device Brand | `getBrand()` | `string` e.g. "Apple / htc / Xiaomi" | | | ||
| Device Model | `getModel()` | `string` e.g. "iPhone 6" | | | ||
| Device ID | `getDeviceId()` | `string` e.g. "iPhone7,2" | Or the board on Android e.g. goldfish | | ||
| System Name | `getSystemName()` | `string` e.g. "iPhone OS" | | | ||
| System Version | `getSystemVersion()` | `string` e.g. "9.0" | | | ||
| Bundle ID | `getBundleId()` | `string` e.g. "com.learnium.mobile" | | | ||
| Build Number | `getBuildNumber()` | `string` e.g. "89" | | | ||
| App Version | `getVersion()` | `string` e.g. "1.1.0" | | | ||
| App Version (Readable) | `getReadableVersion()` | `string` e.g. "1.1.0.89" | | | ||
| Device Name | `getDeviceName()` | `string` e.g. "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)" | | | ||
| Device Locale | `getDeviceLocale()` | `string` e.g. "en-US" | | | ||
| Device Country | `getDeviceCountry()` | `string` e.g. "US" | | | ||
| Timezone | `getTimezone()` | `string` e.g. "America/Mexico_City" | | | ||
| App is running in emulator | `isEmulator()` | `boolean` e.g. true | if app is running in emulator return true | | ||
| App is running on a tablet | `isTablet()` | `boolean` e.g. true | if app is running on a tablet return true | | ||
| PIN or fingerprint set | `isPinOrFingerprintSet()` | `(callback: (isPinOrFingerprintSet: boolean) => void) => void` | Only supported in Android and iOS 9.0 and above | | ||
| API Level | `getAPILevel()` | `number` e.g. 25 | ANDROID ONLY - see [API Levels](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)| | ||
| App Instance ID | `getInstanceID()` | `string` | ANDROID ONLY - see https://developers.google.com/instance-id/ | | ||
| Phone Number | `getPhoneNumber()` | `?string` e.g. "2348675309" or "" | Only supported in Android | | ||
| First Install Time | `getFirstInstallTime()` | `number` e.g. 1505607068808 | Only supported in Android | | ||
| Last Install Time | `getLastUpdateTime()` | `number` e.g. 1505607068808 | Only supported in Android | | ||
| Serial Number | `getSerialNumber()` | `string` | Only supported in Android | ||
| IP Address | `getIPAddress()` | `Promise<string>` | 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 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: | ||
```js | ||
RNDeviceInfo.isPinOrFingerprintSet(isPinOrFingerprintSet => { | ||
RNDeviceInfo.isPinOrFingerprintSet()(isPinOrFingerprintSet => { | ||
if (!isPinOrFingerprintSet) { | ||
@@ -196,0 +204,0 @@ ... |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118813
129
206
1