Skip to content

Commit

Permalink
Merge pull request #636 from segmentio/release-3.5.4
Browse files Browse the repository at this point in the history
Fall back to using Segment integration when we cannot get settings
  • Loading branch information
tonyxiao authored Nov 23, 2016
2 parents 25686ed + edae17c commit 7d4cecb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Analytics/Classes/SEGAnalytics.m
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,16 @@ - (void)refreshSettings
self.settingsRequest = [self.httpClient settingsForWriteKey:self.configuration.writeKey completionHandler:^(BOOL success, NSDictionary *settings) {
if (success) {
[self setCachedSettings:settings];
} else {
// TODO: If settings request fail, fall back to using just Segment integration
// Won't catch situation where this callback never gets called - that will get addressed separately in regular dev
[self setCachedSettings:@{
@"integrations": @{
@"Segment.io": @{ @"apiKey": self.configuration.writeKey },
},
@"plan": @{ @"track": @{} }
}];
}

self.settingsRequest = nil;
}];
}
Expand Down

0 comments on commit 7d4cecb

Please sign in to comment.