react-native-device-info
Advanced tools
Comparing version
## 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
158483
0.63%795
1.53%989
1.64%