Push vibrations update

This commit is contained in:
2026-03-27 22:27:44 +01:00
parent 7b824b6f0c
commit 74722b5e81
6 changed files with 97 additions and 13 deletions
@@ -1,6 +1,7 @@
using cfs_tracker.Data;
using cfs_tracker.Models;
using cfs_tracker.Services;
using Microsoft.Maui.Storage;
using Microsoft.Toolkit.Uwp.Notifications;
using Windows.UI.Notifications;
@@ -9,6 +10,8 @@ namespace cfs_tracker.Platforms.Windows;
public sealed class WindowsNotificationScheduler : INotificationScheduler
{
private const string GroupName = "cfs_tracker_weekly";
private const string PrefVibrationEnabled = "notification_vibration_enabled";
private readonly NotificationScheduleRepository _notificationScheduleRepository;
public WindowsNotificationScheduler(NotificationScheduleRepository notificationScheduleRepository)
@@ -21,6 +24,17 @@ public sealed class WindowsNotificationScheduler : INotificationScheduler
return Task.FromResult(true);
}
public Task<bool> GetVibrationEnabledAsync()
{
return Task.FromResult(Preferences.Default.Get(PrefVibrationEnabled, false));
}
public Task SetVibrationEnabledAsync(bool isEnabled)
{
Preferences.Default.Set(PrefVibrationEnabled, isEnabled);
return Task.CompletedTask;
}
public async Task SyncAsync()
{
try