Iniziata implementazione notifiche firebase

This commit is contained in:
2025-08-25 10:00:41 +02:00
parent 9957229e70
commit 833a1e456f
16 changed files with 244 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
@using salesbook.Shared.Components.Layout.Spinner
@inject IFormFactor FormFactor
@inject INetworkService NetworkService
@inject IFirebaseNotificationService FirebaseNotificationService
<SpinnerLayout FullScreen="true" />
@@ -11,6 +12,15 @@
{
protected override async Task OnInitializedAsync()
{
try
{
await FirebaseNotificationService.InitFirebase();
}
catch (Exception e)
{
Console.WriteLine($"Firebase init: {e.Message}");
}
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
if (!FormFactor.IsWeb() && NetworkService.IsNetworkAvailable() && lastSyncDate.Equals(DateTime.MinValue))