Push vibrations update
This commit is contained in:
@@ -3,5 +3,7 @@ namespace cfs_tracker.Services;
|
||||
public interface INotificationScheduler
|
||||
{
|
||||
Task<bool> EnsurePermissionAsync();
|
||||
Task<bool> GetVibrationEnabledAsync();
|
||||
Task SetVibrationEnabledAsync(bool isEnabled);
|
||||
Task SyncAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
using Microsoft.Maui.Storage;
|
||||
|
||||
namespace cfs_tracker.Services;
|
||||
|
||||
public sealed class NoOpNotificationScheduler : INotificationScheduler
|
||||
{
|
||||
private const string PrefVibrationEnabled = "notification_vibration_enabled";
|
||||
|
||||
public Task<bool> EnsurePermissionAsync() => Task.FromResult(true);
|
||||
|
||||
public Task<bool> GetVibrationEnabledAsync() =>
|
||||
Task.FromResult(Preferences.Default.Get(PrefVibrationEnabled, false));
|
||||
|
||||
public Task SetVibrationEnabledAsync(bool isEnabled)
|
||||
{
|
||||
Preferences.Default.Set(PrefVibrationEnabled, isEnabled);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task SyncAsync() => Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user