Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-device-info

Package Overview
Dependencies
Maintainers
5
Versions
256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-device-info - npm Package Compare versions

Comparing version 0.25.1 to 0.26.0

android/src/main/java/com/learnium/RNDeviceInfo/DeviceType.java

6

CHANGELOG.md
## 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)

9

deviceinfo.d.ts
// 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc