|
|
@ -8,6 +8,7 @@
|
|
|
|
#import <SignalMessaging/Environment.h>
|
|
|
|
#import <SignalMessaging/Environment.h>
|
|
|
|
#import <SignalMessaging/OWSPreferences.h>
|
|
|
|
#import <SignalMessaging/OWSPreferences.h>
|
|
|
|
#import <SignalMessaging/OWSSounds.h>
|
|
|
|
#import <SignalMessaging/OWSSounds.h>
|
|
|
|
|
|
|
|
#import <SignalMessaging/UIUtil.h>
|
|
|
|
|
|
|
|
|
|
|
|
@implementation NotificationSettingsViewController
|
|
|
|
@implementation NotificationSettingsViewController
|
|
|
|
|
|
|
|
|
|
|
@ -47,6 +48,7 @@
|
|
|
|
NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
|
|
|
|
NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
|
|
|
|
@"Label for settings view that allows user to change the notification sound.")
|
|
|
|
@"Label for settings view that allows user to change the notification sound.")
|
|
|
|
detailText:[OWSSounds displayNameForSound:[OWSSounds globalNotificationSound]]
|
|
|
|
detailText:[OWSSounds displayNameForSound:[OWSSounds globalNotificationSound]]
|
|
|
|
|
|
|
|
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"message_sound")
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
|
|
|
|
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
@ -56,24 +58,29 @@
|
|
|
|
@"Table cell switch label. When disabled, Signal will not play notification sounds while the app is in the "
|
|
|
|
@"Table cell switch label. When disabled, Signal will not play notification sounds while the app is in the "
|
|
|
|
@"foreground.");
|
|
|
|
@"foreground.");
|
|
|
|
[soundsSection addItem:[OWSTableItem switchItemWithText:inAppSoundsLabelText
|
|
|
|
[soundsSection addItem:[OWSTableItem switchItemWithText:inAppSoundsLabelText
|
|
|
|
isOnBlock:^{
|
|
|
|
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"in_app_sounds")
|
|
|
|
return [prefs soundInForeground];
|
|
|
|
isOnBlock:^{
|
|
|
|
}
|
|
|
|
return [prefs soundInForeground];
|
|
|
|
target:weakSelf
|
|
|
|
}
|
|
|
|
selector:@selector(didToggleSoundNotificationsSwitch:)]];
|
|
|
|
isEnabledBlock:^{
|
|
|
|
|
|
|
|
return YES;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
target:weakSelf
|
|
|
|
|
|
|
|
selector:@selector(didToggleSoundNotificationsSwitch:)]];
|
|
|
|
[contents addSection:soundsSection];
|
|
|
|
[contents addSection:soundsSection];
|
|
|
|
|
|
|
|
|
|
|
|
OWSTableSection *backgroundSection = [OWSTableSection new];
|
|
|
|
OWSTableSection *backgroundSection = [OWSTableSection new];
|
|
|
|
backgroundSection.headerTitle = NSLocalizedString(@"SETTINGS_NOTIFICATION_CONTENT_TITLE", @"table section header");
|
|
|
|
backgroundSection.headerTitle = NSLocalizedString(@"SETTINGS_NOTIFICATION_CONTENT_TITLE", @"table section header");
|
|
|
|
[backgroundSection
|
|
|
|
[backgroundSection
|
|
|
|
addItem:[OWSTableItem
|
|
|
|
addItem:[OWSTableItem
|
|
|
|
disclosureItemWithText:NSLocalizedString(@"NOTIFICATIONS_SHOW", nil)
|
|
|
|
disclosureItemWithText:NSLocalizedString(@"NOTIFICATIONS_SHOW", nil)
|
|
|
|
detailText:[prefs nameForNotificationPreviewType:[prefs notificationPreviewType]]
|
|
|
|
detailText:[prefs nameForNotificationPreviewType:[prefs notificationPreviewType]]
|
|
|
|
actionBlock:^{
|
|
|
|
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"options")
|
|
|
|
NotificationSettingsOptionsViewController *vc =
|
|
|
|
actionBlock:^{
|
|
|
|
[NotificationSettingsOptionsViewController new];
|
|
|
|
NotificationSettingsOptionsViewController *vc =
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
|
[NotificationSettingsOptionsViewController new];
|
|
|
|
}]];
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
|
|
|
}]];
|
|
|
|
backgroundSection.footerTitle
|
|
|
|
backgroundSection.footerTitle
|
|
|
|
= NSLocalizedString(@"SETTINGS_NOTIFICATION_CONTENT_DESCRIPTION", @"table section footer");
|
|
|
|
= NSLocalizedString(@"SETTINGS_NOTIFICATION_CONTENT_DESCRIPTION", @"table section footer");
|
|
|
|
[contents addSection:backgroundSection];
|
|
|
|
[contents addSection:backgroundSection];
|
|
|
|