@@ -72,10 +72,13 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder {
7272}
7373
7474- (void )commonInit {
75- _blurEffectStyle = UIBlurEffectStyleLight;
7675 self.modalPresentationStyle = UIModalPresentationCustom;
7776 self.transitioningDelegate = self;
78-
77+
78+ _mode = ABReleaseNotesViewControllerModeTesting;
79+
80+ _blurEffectStyle = UIBlurEffectStyleLight;
81+
7982 _closeButtonTitle = NSLocalizedString(@" Dismiss" , @" " );
8083
8184 _lineViewColor = [UIColor colorWithWhite: 0 .f alpha: 0 .25f ];
@@ -109,7 +112,9 @@ - (void)viewDidLoad {
109112 [self createVisualEffectsViews ];
110113
111114 UINavigationBar *navigationBar = [[UINavigationBar alloc ] init ];
112- [navigationBar pushNavigationItem: [[UINavigationItem alloc ] initWithTitle: self .title] animated: YES ];
115+
116+ NSString *title = self.mode == ABReleaseNotesViewControllerModeProduction ? self.title : [NSString stringWithFormat: @" TESTING - %@ " , self .title];
117+ [navigationBar pushNavigationItem: [[UINavigationItem alloc ] initWithTitle: title] animated: YES ];
113118
114119 UIView *bottomEdge = [self .class makeLineViewWithColor: self .lineViewColor];
115120
@@ -168,24 +173,25 @@ - (void)checkForUpdates:(void(^)(BOOL updated))block {
168173 if (!hasIdentifier) {
169174 return ;
170175 }
171-
172- NSString *defaultsAppVersion = [[NSUserDefaults standardUserDefaults ] objectForKey: ABReleaseNotesVersionUserDefaultsKey];
173- if (!defaultsAppVersion) {
174- // it's nil, so write out a value first launch and bail.
175- [[NSUserDefaults standardUserDefaults ] setObject: [self .class appVersionNumber ] forKey: ABReleaseNotesVersionUserDefaultsKey];
176- return ;
177- }
178176
179- // TODO: put me back!
180- // if ([defaultsAppVersion isEqual:[self.class appVersionNumber]]) {
181- // // no new app version installed since last launch.
182- // return;
183- // }
177+ if (self.mode == ABReleaseNotesViewControllerModeProduction) {
178+ NSString *defaultsAppVersion = [[NSUserDefaults standardUserDefaults ] objectForKey: ABReleaseNotesVersionUserDefaultsKey];
179+ if (!defaultsAppVersion) {
180+ // it's nil, so write out a value first launch and bail.
181+ [[NSUserDefaults standardUserDefaults ] setObject: [self .class appVersionNumber ] forKey: ABReleaseNotesVersionUserDefaultsKey];
182+ return ;
183+ }
184+
185+ if ([defaultsAppVersion isEqual: [self .class appVersionNumber ]]) {
186+ // no new app version installed since last launch.
187+ return ;
188+ }
189+ }
184190
185191 // If we've gotten this far, then there's seemingly an update to tell the user about.
186192 self.downloader = [[ABReleaseNotesDownloader alloc ] initWithAppIdentifier: self .appIdentifier];
187193 [self .downloader checkForUpdates: ^(BOOL updated, NSString *releaseNotes, NSString *versionNumber) {
188- if ([versionNumber isEqual: [self .class appVersionNumber ]]) {
194+ if (self. mode == ABReleaseNotesViewControllerModeProduction && [versionNumber isEqual: [self .class appVersionNumber ]]) {
189195 // Belt and suspenders in case something went wrong.
190196 NSLog (@" We downloaded release notes, but the version in the App Store is identical to our local version!" );
191197 NSLog (@" Local: %@ - App Store: %@ " , [self .class appVersionNumber ], versionNumber);
0 commit comments