mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Add support for in-app notifications. (#6341)
This commit is contained in:
@@ -103,6 +103,7 @@ typedef NS_ENUM(NSUInteger, NOTIFICATION_SETTINGS)
|
||||
{
|
||||
NOTIFICATION_SETTINGS_ENABLE_PUSH_INDEX = 0,
|
||||
NOTIFICATION_SETTINGS_SYSTEM_SETTINGS,
|
||||
NOTIFICATION_SETTINGS_SHOW_IN_APP_INDEX,
|
||||
NOTIFICATION_SETTINGS_SHOW_DECODED_CONTENT,
|
||||
NOTIFICATION_SETTINGS_PIN_MISSED_NOTIFICATIONS_INDEX,
|
||||
NOTIFICATION_SETTINGS_PIN_UNREAD_INDEX,
|
||||
@@ -410,6 +411,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
Section *sectionNotificationSettings = [Section sectionWithTag:SECTION_TAG_NOTIFICATIONS];
|
||||
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_ENABLE_PUSH_INDEX];
|
||||
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_SYSTEM_SETTINGS];
|
||||
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_SHOW_IN_APP_INDEX];
|
||||
if (RiotSettings.shared.settingsScreenShowNotificationDecodedContentOption)
|
||||
{
|
||||
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_SHOW_DECODED_CONTENT];
|
||||
@@ -2076,6 +2078,18 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleDefault;
|
||||
}
|
||||
else if (row == NOTIFICATION_SETTINGS_SHOW_IN_APP_INDEX)
|
||||
{
|
||||
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
|
||||
|
||||
labelAndSwitchCell.mxkLabel.text = VectorL10n.settingsEnableInappNotifications;
|
||||
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.showInAppNotifications;
|
||||
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
|
||||
labelAndSwitchCell.mxkSwitch.enabled = account.pushNotificationServiceIsActive;
|
||||
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleShowInAppNotifications:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
cell = labelAndSwitchCell;
|
||||
}
|
||||
else if (row == NOTIFICATION_SETTINGS_SHOW_DECODED_CONTENT)
|
||||
{
|
||||
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
|
||||
@@ -3165,6 +3179,11 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
}
|
||||
}
|
||||
|
||||
- (void)toggleShowInAppNotifications:(UISwitch *)sender
|
||||
{
|
||||
RiotSettings.shared.showInAppNotifications = sender.isOn;
|
||||
}
|
||||
|
||||
- (void)openSystemSettingsApp
|
||||
{
|
||||
NSURL *settingsAppURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
|
||||
|
||||
Reference in New Issue
Block a user