Files
f7push/lib/App/NotificationRelay.php
root df4e2dddec Add f7push v0.1: FCM device registry and push API for F7cloud.
Portable occ-based config, OCS endpoints for APK registration, notification relay, and server-side push dispatch.
2026-05-24 10:26:36 +03:00

37 lines
891 B
PHP

<?php
declare(strict_types=1);
namespace OCA\F7Push\App;
use OCA\F7Push\Service\ConfigService;
use OCA\F7Push\Service\PushDispatcher;
use OCP\Notification\IApp;
use OCP\Notification\INotification;
/**
* Relays F7cloud account notifications to registered mobile devices via Firebase.
* Does not store notifications (handled by the notifications app).
*/
class NotificationRelay implements IApp {
public function __construct(
private PushDispatcher $pushDispatcher,
private ConfigService $config,
) {
}
public function notify(INotification $notification): void {
if (!$this->config->isEnabled() || !$this->config->listenNotifications()) {
return;
}
$this->pushDispatcher->dispatchFromNotification($notification);
}
public function markProcessed(INotification $notification): void {
}
public function getCount(INotification $notification): int {
return 0;
}
}