generated from Integry/Template_NetMauiBlazorHybrid
16 lines
550 B
C#
16 lines
550 B
C#
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);
|
|
}
|
|
} |