feat: instant notifications + Notifications screen
- NotificationPoller polls every 30s while app is in foreground - Poller auto-starts on resume, stops on pause - New NotificationsScreen with mark-as-read, mark-all-read, infinite scroll - Bottom nav: Alerts tab with unread badge - Dashboard: bell icon with unread badge - Backend: GET /api/notifications/unread-count endpoint - App version 1.1.0
This commit is contained in:
@@ -496,6 +496,19 @@ class ApiController
|
||||
]);
|
||||
}
|
||||
|
||||
public function unreadCount(): void
|
||||
{
|
||||
$user = $this->authenticateRequest();
|
||||
|
||||
$notificationModel = new \ServerManager\Models\Notification();
|
||||
$count = $notificationModel->getUnreadCount((int) $user['id']);
|
||||
|
||||
$this->view->json([
|
||||
'success' => true,
|
||||
'unread_count' => $count,
|
||||
]);
|
||||
}
|
||||
|
||||
public function notifications(): void
|
||||
{
|
||||
$user = $this->authenticateRequest();
|
||||
|
||||
Reference in New Issue
Block a user