-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.js
33 lines (28 loc) · 783 Bytes
/
index.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
'use strict';
var { RNAppInfo } = require('react-native').NativeModules;
var AppInfo = {
getInfoVersion: function (){
return RNAppInfo.version;
},
getInfoShortVersion: function (){
return RNAppInfo.shortVersion;
},
getInfoBundleIdentifier: function (){
return RNAppInfo.bundleIdentifier;
},
getInfoName: function (){
return RNAppInfo.name;
},
getInfoDisplayName: function (){
return RNAppInfo.displayName;
},
setNetworkActivityIndicatorVisible: function (visible) {
if (Platform.OS === 'ios') {
var appInfo = require('react-native').NativeModules.RNAppInfo;
appInfo.setNetworkActivityIndicatorVisible(visible);
} else {
console.warn('setNetworkActivityIndicatorVisible function not supported by Android');
}
}
};
module.exports = AppInfo;