react-native-device-info
Advanced tools
Comparing version
## Release Notes | ||
### 1.3.0 | ||
* feat: Add support for preferred languages function (https://github.com/react-native-community/react-native-device-info/pull/610) | ||
### 1.2.0 | ||
@@ -4,0 +7,0 @@ * feat: Support 'dom' Platform.OS for react-native-dom (https://github.com/react-native-community/react-native-device-info/pull/406) |
@@ -25,2 +25,3 @@ /** | ||
deviceLocale: '', | ||
preferredLocales: [], | ||
deviceCountry: '', | ||
@@ -27,0 +28,0 @@ timezone: '', |
@@ -22,2 +22,3 @@ // should be imported this way: | ||
getDeviceLocale: () => string; | ||
getPreferredLocales: () => Array<string>; | ||
getDeviceCountry: () => string; | ||
@@ -24,0 +25,0 @@ getTimezone: () => string; |
@@ -260,2 +260,5 @@ /** | ||
}, | ||
getPreferredLocales: function() { | ||
return RNDeviceInfo.preferredLocales; | ||
}, | ||
getDeviceCountry: function() { | ||
@@ -262,0 +265,0 @@ return RNDeviceInfo.deviceCountry; |
{ | ||
"name": "react-native-device-info", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Get device information using react-native", | ||
@@ -5,0 +5,0 @@ "main": "deviceinfo.js", |
@@ -222,2 +222,3 @@ # react-native-device-info | ||
| [getDeviceLocale()](#getdevicelocale) | `string` | ✅ | ✅ | ✅ | 0.7.0 | | ||
| [getPreferredLocales()](#getpreferredlocale) | `Array<string>` | ✅ | ✅ | ❌ | ? | | ||
| [getDeviceName()](#getdevicename) | `string` | ✅ | ✅ | ✅ | ? | | ||
@@ -424,2 +425,18 @@ | [getFirstInstallTime()](#getfirstinstalltime) | `number` | ❌ | ✅ | ✅ | 0.12.0 | | ||
### getPreferredLocales() | ||
Gets the preferred locales defined by the user. | ||
**Examples** | ||
```js | ||
const preferredLocales = DeviceInfo.getPreferredLocales(); | ||
// iOS: "[es-ES, en-US]" | ||
// Android: "[es-ES, en-US]" | ||
// Windows: ? | ||
``` | ||
--- | ||
### getDeviceName() | ||
@@ -426,0 +443,0 @@ |
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
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
203627
46.99%41
13.89%871
2.23%1101
1.57%0
-100%