Gestita pagina notifiche

This commit is contained in:
2025-09-11 16:06:19 +02:00
parent 7319378e75
commit 7bfe67a97c
30 changed files with 611 additions and 105 deletions

View File

@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.Messaging;
using salesbook.Shared.Core.Dto.Notification;
using salesbook.Shared.Core.Entity;
using salesbook.Shared.Core.Interface.IntegryApi;
using salesbook.Shared.Core.Messages.Notification;
using Shiny.Push;
@@ -7,7 +7,7 @@ using Shiny.Push;
namespace salesbook.Maui.Core.System.Notification.Push;
public class PushNotificationDelegate(
IIntegryNotificationRestClient integryNotificationRestClient,
IIntegryRegisterNotificationRestClient integryRegisterNotificationRestClient,
IMessenger messenger
) : IPushDelegate
{
@@ -20,10 +20,10 @@ public class PushNotificationDelegate(
public Task OnReceived(PushNotification notification)
{
if (notification.Notification is null) return Task.CompletedTask;
var pushNotification = new PushNotificationDTO
var pushNotification = new WtbNotification
{
Title = notification.Notification.Title,
Message = notification.Notification.Message
Body = notification.Notification.Message
};
messenger.Send(new NewPushNotificationMessage(pushNotification));
@@ -33,7 +33,7 @@ public class PushNotificationDelegate(
public Task OnNewToken(string token)
{
integryNotificationRestClient.Register(token);
integryRegisterNotificationRestClient.Register(token);
return Task.CompletedTask;
}