Show migration screen at first launch.

sort sounds alphabetically (other than Default/None)

// FREEBIE
This commit is contained in:
Michael Kirk 2018-03-06 12:27:04 -05:00
parent 9afce87ddc
commit 5739f074ae
3 changed files with 19 additions and 16 deletions

View File

@ -44,8 +44,8 @@ private class IntroducingCustomNotificationAudioExperienceUpgradeViewController:
let button = addButton(title: buttonTitle) { _ in
// dismiss the modally presented view controller, then proceed.
self.experienceUpgradesPageViewController.dismiss(animated: true) {
guard let fromViewController = UIApplication.shared.frontmostViewController as? HomeViewController else {
owsFail("unexpected frontmostViewController: \(String(describing: UIApplication.shared.frontmostViewController))")
guard let fromViewController = UIApplication.shared.frontmostViewController else {
owsFail("frontmostViewController was unexectedly nil")
return
}

View File

@ -287,6 +287,22 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[self updateBarButtonItems];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// Keep in mind viewDidAppear is called while the app is in the background if the app was
// launched by a voip notification. This is fine - it will remain visible to the user
// when they eventually launch the app, but we shouldn't make any changes assuming
// the user has *seen* the upgrade experience at this point.
if (!self.hasShownAnyUnseenUpgradeExperiences) {
dispatch_async(dispatch_get_main_queue(), ^{
[self displayAnyUnseenUpgradeExperience];
self.hasShownAnyUnseenUpgradeExperiences = YES;
});
}
}
- (void)updateBarButtonItems
{
const CGFloat kBarButtonSize = 44;
@ -510,19 +526,6 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
});
}];
}
// We want to show the user the upgrade experience as soon as the app is visible to them.
// It cannot go in viewDidAppear, which is called while the app is in the background if
// we were launched from a voip notification.
if (!self.hasShownAnyUnseenUpgradeExperiences) {
dispatch_async(dispatch_get_main_queue(), ^{
if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateActive) {
return;
}
[self displayAnyUnseenUpgradeExperience];
self.hasShownAnyUnseenUpgradeExperiences = YES;
});
}
}
#pragma mark - startup

View File

@ -74,8 +74,8 @@ NSString *const kOWSSoundsStorageGlobalNotificationKey = @"kOWSSoundsStorageGlob
@(OWSSound_Keys),
@(OWSSound_Popcorn),
@(OWSSound_Pulse),
@(OWSSound_Synth),
@(OWSSound_ClassicNotification),
@(OWSSound_Synth),
];
}