WarplyReactMethods.m
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
//
// WarplyEvents.m
// App
//
// Created by Fotios Kalaitzidis on 23/10/2018.
// Copyright © 2018 Facebook. All rights reserved.
//
#import "WarplyReactMethods.h"
#import "WLUserManager.h"
#import "WLAnalyticsManager.h"
#import "Warply.h"
#import "WLEvent.h"
#import <AdSupport/AdSupport.h>
@implementation WarplyReactMethods
- (void) sendEvent: (NSString *) eventName priority: (BOOL) priority {
NSString *event_Name = eventName;
NSNumber *time_submitted = [NSNumber numberWithDouble:[[NSDate date] timeIntervalSince1970]];
NSDictionary *inapp_event = [NSDictionary dictionaryWithObjectsAndKeys:event_Name, @"event_id", nil, @"page_id", time_submitted, @"time_submitted", nil, @"action_metadata", nil];
NSDictionary *eventContext = [NSDictionary dictionaryWithObject:inapp_event forKey:@"inapp_analytics"];
WLEventSimple *simpleEvent = [[WLEventSimple alloc] initWithType:@"inapp_analytics" andContext:eventContext];
[[Warply sharedService] addEvent:simpleEvent priority:priority];
}
- (NSString *) getUniqueId {
return [[[UIDevice currentDevice] identifierForVendor] UUIDString];
}
- (NSString *) getAdvertisementId {
return [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];
}
@end