Skip to content

Commit

Permalink
Map custom events to associated token
Browse files Browse the repository at this point in the history
Adjust expects a token to identify the event to be tracked.
AdjustProvider now relies on a “Event -to- Token” map to retrieve the
proper event token.
  • Loading branch information
saidmarouf authored and saidmarouf committed Dec 11, 2014
1 parent c081ca5 commit 6e44ea7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Providers/AdjustProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
#import "ARAnalyticalProvider.h"

@interface AdjustProvider : ARAnalyticalProvider

@property (nonatomic, strong) NSDictionary *eventTokenMap;
@end
8 changes: 6 additions & 2 deletions Providers/AdjustProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ - (id)initWithIdentifier:(NSString *)identifier {
}

- (void)event:(NSString *)event withProperties:(NSDictionary *)properties {
[Adjust trackEvent:event withParameters:properties];
if(_eventTokenMap && [_eventTokenMap containsKey:event])
[Adjust trackEvent:_eventTokenMap[event] withParameters:properties];
}


- (void) setEventTokenMap:(NSDictionary *)eventTokenMap {
if(_eventTokenMap != eventTokenMap)
_eventTokenMap = eventTokenMap;
}



Expand Down

0 comments on commit 6e44ea7

Please sign in to comment.