-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRCTDataCortex.m
More file actions
44 lines (34 loc) · 1.21 KB
/
RCTDataCortex.m
File metadata and controls
44 lines (34 loc) · 1.21 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
#import "RCTDataCortex.h"
#import "DataCortex.h"
@implementation RCTDataCortex
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(sharedInstance:(NSString *)apiKey
forOrg:(NSString *)org
callback:(RCTResponseSenderBlock)callback) {
[DataCortex sharedInstanceWithAPIKey:apiKey forOrg:org];
callback(@[[NSNull null]]);
}
RCT_EXPORT_METHOD(getDeviceTag:(RCTResponseSenderBlock)callback) {
NSString *deviceTag = [[DataCortex sharedInstance] getDeviceTag];
if (deviceTag == nil) {
deviceTag = @"";
}
callback(@[[NSNull null],deviceTag]);
}
RCT_EXPORT_METHOD(eventWithProperties:(NSDictionary *)properties) {
[[DataCortex sharedInstance] eventWithProperties:properties];
}
RCT_EXPORT_METHOD(economyWithProperties:(NSDictionary *)properties
spendCurrency:(NSString *)spendCurrency
spendAmount:(float)spendAmount) {
[[DataCortex sharedInstance] economyWithProperties:properties
spendCurrency:spendCurrency
spendAmount:[NSNumber numberWithFloat:spendAmount]];
}
RCT_EXPORT_METHOD(addUserTag:(NSString *) userTag) {
[[DataCortex sharedInstance] setUserTag:userTag];
}
RCT_EXPORT_METHOD(appLogWithProperties:(NSDictionary *)properties) {
[[DataCortex sharedInstance] appLogWithProperties:properties];
}
@end