Skip to content

Commit

Permalink
Turn off UI alerts unless the user wants them for debugging
Browse files Browse the repository at this point in the history
User wants them == "simulateUserInteraction"
Note that introduces a new, ugly dependency.
Fixing that is tracked in
e-mission/e-mission-data-collection#113
  • Loading branch information
shankari committed Jun 8, 2016
1 parent f99c239 commit f55fc2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ios/LocalNotificationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "LocalNotificationManager.h"
#import "ConfigManager.h"
#import "DBLogging.h"
#import <UIKit/UIKit.h>

Expand Down Expand Up @@ -34,7 +35,10 @@ +(void)addNotification:(NSString *)notificationMessage showUI:(BOOL)showUI {
}
[[DBLogging database] log:notificationMessage atLevel:level];

if (showUI) {
// TODO: This adds a dependency between the notification manager and the config manager
// This is not a good thing, but it works for now
// Filed https://github.com/e-mission/e-mission-data-collection/issues/113 to track longer term issue
if (showUI && [ConfigManager instance].simulate_user_interaction) {
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif) {
localNotif.alertBody = notificationMessage;
Expand Down

0 comments on commit f55fc2d

Please sign in to comment.