feat(): push notifications via firebase admin

This commit is contained in:
doas root
2025-11-20 21:25:48 +03:00
parent c010984d64
commit fa24f4060f
22 changed files with 706 additions and 3 deletions
@@ -0,0 +1,20 @@
import asyncio
from typing import override
from firebase_admin import messaging # type: ignore[import-untyped]
from firebase_admin.messaging import Message, Notification # type: ignore[import-untyped]
from template_project.application.common.notifications.service import NotificationService
class FCMNotificationService(NotificationService):
def __init__(self) -> None:
pass
@override
async def send_notification(self, identifier: str, title: str, body: str) -> None:
message = Message(
token=identifier,
notification=Notification(title=title, body=body),
)
await asyncio.to_thread(messaging.send, message)