-
Notifications
You must be signed in to change notification settings - Fork 34
/
DeviceUtil.m
31 lines (24 loc) · 866 Bytes
/
DeviceUtil.m
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
#import "DeviceUtil.h"
#import "RCTBridge.h"
#import "RCTUtils.h"
#import <sys/utsname.h>
@implementation DeviceUtil
RCT_EXPORT_MODULE();
@synthesize bridge = _bridge;
- (NSDictionary *)constantsToExport {
NSString *model = [[UIDevice currentDevice] model];
NSString *name = [[UIDevice currentDevice] name];
NSString *systemName = [[UIDevice currentDevice] systemName];
NSString *systemVersion = [[UIDevice currentDevice] systemVersion];
struct utsname systemInfo;
uname(&systemInfo);
NSString *deviceVersion = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
return @{
@"model" : (model),
@"name" : (name),
@"systemName" : (systemName),
@"systemVersion" : (systemVersion),
@"deviceVersion" : (deviceVersion)
};
}
@end