-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice_util.js
executable file
·35 lines (33 loc) · 1.02 KB
/
device_util.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import DeviceInfo from 'react-native-device-info';
module.exports = {
getAppVersion: function () {
const nativeAppVersion = DeviceInfo.getVersion();
const PACKAGE = require('../../package.json');
const reactNativeAppVersion = PACKAGE.version;
return DeviceInfo.getVersion() + "." + reactNativeAppVersion;
},
getAppBuildNumber: function () {
return DeviceInfo.getBuildNumber();
},
getAppBundleId: function () {
return DeviceInfo.getBundleId();
},
getDeviceLocale: function () {
return DeviceInfo.getDeviceLocale();
},
getDeviceCountry: function () {
return DeviceInfo.getDeviceCountry();
},
getTimezone: function () {
return DeviceInfo.getTimezone();
},
getDeviceOS: function () {
return DeviceInfo.getSystemName();
},
getDeviceUniqueID: function () {
return DeviceInfo.getUniqueID();
},
isProductionMode: function () {
return !this.getAppBundleId().endsWith(".debug") && !this.getAppBundleId().endsWith(".staging");
}
};