Skip to content

Commit

Permalink
Send disabled events to Segment. (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
f2prateek authored Nov 2, 2017
1 parent f7af753 commit 4e7cfbc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Analytics/Classes/Integrations/SEGIntegrationsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ - (void)refreshSettings

- (BOOL)isIntegration:(NSString *)key enabledInOptions:(NSDictionary *)options
{
// If the event is in the tracking plan, it should always be sent to api.segment.io.
if ([@"Segment.io" isEqualToString:key]) {
return YES;
}
Expand All @@ -412,6 +413,11 @@ - (BOOL)isIntegration:(NSString *)key enabledInOptions:(NSDictionary *)options

- (BOOL)isTrackEvent:(NSString *)event enabledForIntegration:(NSString *)key inPlan:(NSDictionary *)plan
{
// Whether the event is enabled or disabled, it should always be sent to api.segment.io.
if ([key isEqualToString:@"Segment.io"]) {
return YES;
}

if (plan[@"track"][event]) {
if ([plan[@"track"][event][@"enabled"] boolValue]) {
return [self isIntegration:key enabledInOptions:plan[@"track"][event][@"integrations"]];
Expand Down

0 comments on commit 4e7cfbc

Please sign in to comment.