Iniziata implementazione notifiche firebase
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using salesbook.Shared.Core.Interface;
|
||||
using Shiny;
|
||||
using Shiny.Push;
|
||||
|
||||
namespace salesbook.Maui.Core.System.Notification;
|
||||
|
||||
public class FirebaseNotificationService(IPushManager pushManager, IIntegryNotificationRestClient integryNotificationRestClient) : IFirebaseNotificationService
|
||||
{
|
||||
public async Task InitFirebase()
|
||||
{
|
||||
var (accessState, token) = await pushManager.RequestAccess();
|
||||
|
||||
if (accessState == AccessState.Denied || token is null) return;
|
||||
await integryNotificationRestClient.Register(token);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user