react-native-device-info
Advanced tools
Comparing version 0.26.5 to 0.27.0
## Release Notes | ||
### 0.27.0 | ||
* Added `isBatteryCharging()` (https://github.com/rebeccahughes/react-native-device-info/pull/514) | ||
### 0.26.5 | ||
@@ -4,0 +7,0 @@ * Use BigInteger to avoid overflow in Disk related functions (https://github.com/rebeccahughes/react-native-device-info/pull/587) |
@@ -45,2 +45,3 @@ // should be imported this way: | ||
getBatteryLevel: () => Promise<number>; | ||
isBatteryCharging: () => Promise<boolean>; | ||
isLandscape: () => boolean; | ||
@@ -47,0 +48,0 @@ isAirPlaneMode: () => Promise<boolean>; |
@@ -302,2 +302,5 @@ /** | ||
}, | ||
isBatteryCharging: function() { | ||
return RNDeviceInfo.isBatteryCharging(); | ||
}, | ||
isLandscape: function() { | ||
@@ -304,0 +307,0 @@ const { height, width } = Dimensions.get('window'); |
{ | ||
"name": "react-native-device-info", | ||
"version": "0.26.5", | ||
"version": "0.27.0", | ||
"description": "Get device information using react-native", | ||
@@ -5,0 +5,0 @@ "main": "deviceinfo.js", |
@@ -247,2 +247,3 @@ # react-native-device-info | ||
| [isAirPlaneMode()](#isairplanemode) | `Promise<boolean>` | ❌ | ✅ | ❌ | 0.25.0 | | ||
| [isBatteryCharging()](#isbatterycharging) | `Promise<boolean>` | ❌ | ✅ | ❌ | 0.27.0 | | ||
| [isEmulator()](#isemulator) | `boolean` | ✅ | ✅ | ✅ | ? | | ||
@@ -828,2 +829,17 @@ | [isPinOrFingerprintSet()](#ispinorfingerprintset) | (callback)`boolean` | ✅ | ✅ | ✅ | 0.10.1 | | ||
--- | ||
### isBatteryCharging() | ||
Tells if the battery is currently charging. | ||
**Examples** | ||
```js | ||
DeviceInfo.isBatteryCharging().then(isCharging => { | ||
// true or false | ||
}); | ||
``` | ||
--- | ||
### isEmulator() | ||
@@ -897,2 +913,3 @@ | ||
Returns the device's type as a string, which will be one of: | ||
* `Handset` | ||
@@ -909,3 +926,2 @@ * `Tablet` | ||
## Troubleshooting | ||
@@ -912,0 +928,0 @@ |
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
158483
411
989