-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeviceinfo.js
More file actions
71 lines (69 loc) · 1.44 KB
/
deviceinfo.js
File metadata and controls
71 lines (69 loc) · 1.44 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* @providesModule react-native-device-info
*/
import { NativeModules, Platform } from 'react-native';
const { RNDeviceInfo } = NativeModules;
export default {
getUniqueID() {
return RNDeviceInfo.uniqueId;
},
getInstanceID() {
return RNDeviceInfo.instanceId;
},
getDeviceId() {
return RNDeviceInfo.deviceId;
},
getManufacturer() {
return RNDeviceInfo.systemManufacturer;
},
getModel() {
return RNDeviceInfo.model;
},
getBrand() {
return RNDeviceInfo.brand;
},
getSystemName() {
return RNDeviceInfo.systemName;
},
getSystemVersion() {
return RNDeviceInfo.systemVersion;
},
getBundleId() {
return RNDeviceInfo.bundleId;
},
getBuildNumber() {
return RNDeviceInfo.buildNumber;
},
getVersion() {
return RNDeviceInfo.appVersion;
},
getReadableVersion() {
return RNDeviceInfo.appVersion + "." + RNDeviceInfo.buildNumber;
},
getDeviceName() {
return RNDeviceInfo.deviceName;
},
getUserAgent() {
return RNDeviceInfo.userAgent;
},
getDeviceLocale() {
return RNDeviceInfo.deviceLocale;
},
getDeviceCountry() {
return RNDeviceInfo.deviceCountry;
},
getTimezone() {
return RNDeviceInfo.timezone;
},
getMacAddress() {
return RNDeviceInfo.macAddress;
},
getIdfa() {
if (Platform === 'android') return '';
return RNDeviceInfo.idfa;
},
getImei() {
if (Platform === 'ios') return '';
return RNDeviceInfo.imei;
},
}