Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Source/Controllers/LIFENavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ - (void)_configureNavigationBarAppearance
self.navigationBar.translucent = NO;
[self.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];

// See https://developer.apple.com/forums/thread/682420
if (@available(iOS 13.0, *)) {
UINavigationBarAppearance *nba = [[UINavigationBarAppearance alloc] init];
[nba configureWithOpaqueBackground];
nba.backgroundColor = appearance.barTintColor;
self.navigationBar.standardAppearance = nba;
self.navigationBar.scrollEdgeAppearance = self.navigationBar.standardAppearance;
}

UIBarButtonItem *barButtonItemAppearance = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[LIFENavigationBar class]]];
barButtonItemAppearance.tintColor = appearance.tintColor;
[barButtonItemAppearance setTitleTextAttributes:@{NSForegroundColorAttributeName : appearance.tintColor} forState:UIControlStateNormal];
Expand Down
22 changes: 20 additions & 2 deletions Source/Services/LIFEDataProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
static NSString * const kLegacyPendingReportsDirectory = @"cached_reports";
static NSString * const kPendingReportsDirectory = @"pending_reports";
static NSString * const kPlatform = @"ios";
static NSString * const kApiClientEvents = @"api/v1/client_events.json";
static NSString * const kApiReports = @"api/v1/reports.json";

@interface LIFEDataProvider ()

Expand Down Expand Up @@ -119,8 +121,16 @@ - (void)logClientEventWithName:(nonnull NSString *)eventName

[params life_safeSetObject:appParams forKey:@"app"];
[params life_safeSetObject:clientEventParams forKey:@"client_event"];

NSString *apiClientEvents = kApiClientEvents;

NSDictionary *environment = [[NSProcessInfo processInfo] environment];
NSString *overridePath = environment[@"com.buglife.api.client_events"];
if (overridePath) {
apiClientEvents = overridePath;
}

[self.networkManager POST:@"api/v1/client_events.json" parameters:params callbackQueue:self.workQueue success:^(id responseObject) {
[self.networkManager POST:apiClientEvents parameters:params callbackQueue:self.workQueue success:^(id responseObject) {
LIFELogIntDebug(@"Successfully posted event \"%@\"", eventName);
} failure:^(NSError *error) {
LIFELogIntError(@"Error posting event \"%@\"\n Error: %@", eventName, error);
Expand Down Expand Up @@ -181,8 +191,16 @@ - (void)_submitReport:(nonnull LIFEReport *)report withRetryPolicy:(LIFERetryPol
// TODO: Need to remove & re-save so that submissionAttempts actually increments beyond 2
[self _savePendingReport:report];
}

NSString *apiReports = kApiReports;

NSDictionary *environment = [[NSProcessInfo processInfo] environment];
NSString *overridePath = environment[@"com.buglife.api.reports"];
if (overridePath) {
apiReports = overridePath;
}

[_networkManager POST:@"api/v1/reports.json" parameters:parameters callbackQueue:self.workQueue success:^(id responseObject) {
[_networkManager POST:apiReports parameters:parameters callbackQueue:self.workQueue success:^(id responseObject) {

LIFELogIntInfo(@"Report submitted!");
if (removeSuccessfulSubmissions) {
Expand Down