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.22.6 to 0.23.0

3

CHANGELOG.md

@@ -5,2 +5,5 @@ ## Release Notes

### 0.23.0
* Add `hasNotch()` (https://github.com/rebeccahughes/react-native-device-info/pull/500)
### 0.22.6

@@ -7,0 +10,0 @@ * Support new models (XR, XS, XS Max) and iPad 6th Gen (https://github.com/rebeccahughes/react-native-device-info/pull/499)

@@ -29,2 +29,3 @@ // should be imported this way:

isPinOrFingerprintSet: (cb: (isPinOrFingerprintSet: boolean) => void) => void;
hasNotch: () => boolean;
getFirstInstallTime: () => number;

@@ -31,0 +32,0 @@ getLastUpdateTime: () => number;

@@ -12,2 +12,117 @@ /**

const devicesWithNotch = [
{
brand: 'Apple',
model: 'iPhone X',
},
{
brand: 'Apple',
model: 'iPhone XS',
},
{
brand: 'Apple',
model: 'iPhone XS Max',
},
{
brand: 'Apple',
model: 'iPhone XR',
},
{
brand: 'Asus',
model: 'ZenFone 5',
},
{
brand: 'Asus',
model: 'ZenFone 5z',
},
{
brand: 'Huawei',
model: 'P20',
},
{
brand: 'Huawei',
model: 'P20 Plus',
},
{
brand: 'Huawei',
model: 'P20 Lite',
},
{
brand: 'Huawei',
model: 'Honor 10',
},
{
brand: 'Huawei',
model: 'Nova 3',
},
{
brand: 'Huawei',
model: 'Nova 3i',
},
{
brand: 'Oppo',
model: 'R15',
},
{
brand: 'Oppo',
model: 'R15 Pro',
},
{
brand: 'Oppo',
model: 'F7',
},
{
brand: 'Vivo',
model: 'V9',
},
{
brand: 'Vivo',
model: 'X21',
},
{
brand: 'Vivo',
model: 'X21 UD',
},
{
brand: 'OnePlus',
model: '6',
},
{
brand: 'OnePlus',
model: 'A6003',
},
{
brand: 'OnePlus',
model: 'OnePlus A6003',
},
{
brand: 'LG',
model: 'G7',
},
{
brand: 'LG',
model: 'G7 ThinQ',
},
{
brand: 'LG',
model: 'G7+ ThinQ',
},
{
brand: 'Leagoo',
model: 'S9',
},
{
brand: 'Oukitel',
model: 'U18',
},
{
brand: 'Sharp',
model: 'Aquos S3',
},
{
brand: 'Nokia',
model: '6.1 Plus',
},
];
export default {

@@ -95,2 +210,5 @@ getUniqueID: function() {

},
hasNotch: function() {
return devicesWithNotch.findIndex(item => item.brand === RNDeviceInfo.brand && item.model === RNDeviceInfo.model) !== -1;
},
getFirstInstallTime: function() {

@@ -97,0 +215,0 @@ return RNDeviceInfo.firstInstallTime;

2

package.json
{
"name": "react-native-device-info",
"version": "0.22.6",
"version": "0.23.0",
"description": "Get device information using react-native",

@@ -5,0 +5,0 @@ "main": "deviceinfo.js",

@@ -236,2 +236,3 @@ # react-native-device-info

| [isTablet()](#istablet) | `boolean` | ✅ | ✅ | ✅ | ? |
| [hasNotch()](#hasNotch) | `boolean` | ✅ | ✅ | ✅ | ? |

@@ -837,2 +838,14 @@ ---

---
### hasNotch()
Tells if the device has a notch.
**Examples**
```js
const hasNotch = DeviceInfo.hasNotch(); // true
```
## Troubleshooting

@@ -839,0 +852,0 @@

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