react-native-device-info
Advanced tools
Comparing version 3.0.0-rc.4 to 3.0.0-rc.5
@@ -5,2 +5,9 @@ <!-- markdownlint-disable MD024 MD034 MD033 --> | ||
## 3.0.0-rc.5 | ||
- fix: various fixes similar to / prompted by #771 / #768 / #769 | ||
- fix: getSystemName() returns value on ios+android [#771](https://github.com/react-native-community/react-native-device-info/issues/771) thanks @cmpayc! | ||
- fix: getUniqueId() only returned value 1st call [#768](https://github.com/react-native-community/react-native-device-info/issues/768) thanks @tamhv! | ||
- fix: getModel() not working on iOS [#769](https://github.com/react-native-community/react-native-device-info/pull/769) Thanks @rnnyrk! | ||
## 3.0.0-rc.4 | ||
@@ -7,0 +14,0 @@ |
@@ -357,4 +357,4 @@ /** | ||
} | ||
return uniqueId; | ||
} | ||
return uniqueId; | ||
} | ||
@@ -473,4 +473,3 @@ | ||
return RNDeviceInfo.getMacAddress(); | ||
} | ||
if (OS === 'ios') { | ||
} else if (OS === 'ios') { | ||
return '02:00:00:00:00:00'; | ||
@@ -484,4 +483,3 @@ } | ||
return RNDeviceInfo.getMacAddressSync(); | ||
} | ||
if (OS === 'ios') { | ||
} else if (OS === 'ios') { | ||
return '02:00:00:00:00:00'; | ||
@@ -547,5 +545,5 @@ } | ||
let deviceName; | ||
let device = await RNDeviceInfo.getDeviceId(); | ||
if (deviceId) { | ||
deviceName = deviceNamesByCode[device]; | ||
let _deviceId = await RNDeviceInfo.getDeviceId(); | ||
if (_deviceId) { | ||
deviceName = deviceNamesByCode[_deviceId]; | ||
if (!deviceName) { | ||
@@ -578,5 +576,5 @@ // Not found on database. At least guess main device type from string contents: | ||
var deviceName; | ||
var device = RNDeviceInfo.getDeviceIdSync(); | ||
if (deviceId) { | ||
deviceName = deviceNamesByCode[device]; | ||
var _deviceId = RNDeviceInfo.getDeviceIdSync(); | ||
if (_deviceId) { | ||
deviceName = deviceNamesByCode[_deviceId]; | ||
if (!deviceName) { | ||
@@ -628,4 +626,4 @@ // Not found on database. At least guess main device type from string contents: | ||
} | ||
return brand; | ||
} | ||
return brand; | ||
} | ||
@@ -655,4 +653,3 @@ | ||
systemName = 'Android'; | ||
} | ||
if (OS === 'windows') { | ||
} else if (OS === 'windows') { | ||
systemName = 'Windows'; | ||
@@ -705,4 +702,5 @@ } else { | ||
buildId = RNDeviceInfo.getBuildIdSync(); | ||
} else { | ||
buildId = 'unknown'; | ||
} | ||
buildId = 'unknown'; | ||
} | ||
@@ -925,14 +923,23 @@ return buildId; | ||
let device; | ||
export async function getDevice() { | ||
if (OS === 'android') { | ||
return RNDeviceInfo.getDevice(); | ||
if (!device) { | ||
if (OS === 'android') { | ||
device = RNDeviceInfo.getDevice(); | ||
} else { | ||
device = 'unknown'; | ||
} | ||
} | ||
return Promise.resolve('unknown'); | ||
return device; | ||
} | ||
export function getDeviceSync() { | ||
if (OS === 'android') { | ||
return RNDeviceInfo.getDeviceSync(); | ||
if (!device) { | ||
if (OS === 'android') { | ||
device = RNDeviceInfo.getDeviceSync(); | ||
} else { | ||
device = 'unknown'; | ||
} | ||
} | ||
return 'unknown'; | ||
return device; | ||
} | ||
@@ -939,0 +946,0 @@ |
{ | ||
"name": "react-native-device-info", | ||
"version": "3.0.0-rc.4", | ||
"version": "3.0.0-rc.5", | ||
"description": "Get device information using react-native", | ||
@@ -5,0 +5,0 @@ "main": "deviceinfo.js", |
@@ -80,4 +80,17 @@ <!-- markdownlint-disable MD024 MD034 MD033 --> | ||
<details> | ||
<summary>iOS (via CocoaPods)</summary> | ||
<summary>iOS (via CocoaPods) RN <= 59 </summary> | ||
RN <= 59: [`Bug`](https://github.com/react-native-community/react-native-device-info/issues/748) | ||
``` | ||
mv ios/Podfile . | ||
react-native link react-native-device-info | ||
mv Podfile ios | ||
``` | ||
Do _not_ append `pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'` to the Podfile | ||
</details> | ||
<details> | ||
<summary>iOS (via CocoaPods) RN >= 60</summary> | ||
Add the following lines to your build targets in your `Podfile` | ||
@@ -84,0 +97,0 @@ |
Sorry, the diff of this file is not supported yet
297724
2609
1581