react-native-device-info
Advanced tools
Comparing version 0.25.1 to 0.26.0
## Release Notes | ||
### 0.26.0 | ||
* Added `getDeviceType()` and used it in `isTablet()` (https://github.com/rebeccahughes/react-native-device-info/pull/560) | ||
### 0.25.1 | ||
* Added Google Pixel 3XL to notch devices (https://github.com/rebeccahughes/react-native-device-info/pull/535) | ||
### 0.25.0 | ||
@@ -4,0 +10,0 @@ * Added `isAirPlaneMode()` (https://github.com/rebeccahughes/react-native-device-info/pull/524) |
// should be imported this way: | ||
// import DeviceInfo from 'react-native-device-info'; | ||
export type DeviceType = 'Handset' | 'Tablet' | 'Tv' | 'Unknown'; | ||
declare const _default: { | ||
@@ -33,4 +35,4 @@ getUniqueID: () => string; | ||
getSerialNumber: () => string; | ||
getIPAddress: () => Promise<string> | ||
getMACAddress: () => Promise<string> | ||
getIPAddress: () => Promise<string>; | ||
getMACAddress: () => Promise<string>; | ||
getPhoneNumber: () => string; | ||
@@ -44,6 +46,7 @@ getAPILevel: () => number; | ||
getBatteryLevel: () => Promise<number>; | ||
isLandscape: () => boolean; | ||
isLandscape: () => boolean; | ||
isAirPlaneMode: () => Promise<boolean>; | ||
getDeviceType: () => DeviceType; | ||
}; | ||
export default _default; |
@@ -288,3 +288,6 @@ /** | ||
return RNDeviceInfo.isAirPlaneMode(); | ||
} | ||
}, | ||
getDeviceType: function() { | ||
return RNDeviceInfo.deviceType; | ||
}, | ||
}; |
{ | ||
"name": "react-native-device-info", | ||
"version": "0.25.1", | ||
"version": "0.26.0", | ||
"description": "Get device information using react-native", | ||
@@ -5,0 +5,0 @@ "main": "deviceinfo.js", |
@@ -252,2 +252,3 @@ # react-native-device-info | ||
| [isLandscape()](#isLandscape) | `boolean` | ✅ | ✅ | ✅ | 0.24.0 | | ||
| [getDeviceType()](#getDeviceType) | `string` | ✅ | ✅ | ❌ | ? | | ||
@@ -892,2 +893,17 @@ --- | ||
### getDeviceType() | ||
Returns the device's type as a string, which will be one of: | ||
* `Handset` | ||
* `Tablet` | ||
* `Tv` | ||
* `Unknown` | ||
**Examples** | ||
```js | ||
const deviceType = DeviceInfo.getDeviceType(); // 'Handset' | ||
``` | ||
## Troubleshooting | ||
@@ -894,0 +910,0 @@ |
@@ -42,3 +42,4 @@ /** | ||
getBatteryLevel: () => Promise.resolve(0), | ||
isLandscape: false | ||
isLandscape: false, | ||
deviceType: 'Unknown', | ||
}; |
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
198412
42
387
973