Add in-app + real-time notifications (SignalR/mock, Iran-friendly)

- AppNotification + OnlineService.onNotification (hub event + mock periodic) —
  no FCM/APNs (blocked in Iran); uses the existing realtime channel
- notification-store + pushNotification(); 🔔 bell with unread badge in TopBar,
  notifications screen, global toaster (plays notify sfx)
- Wired events: daily reward, post-match achievements, friend requests
- Closed-app push (Pushe/Najva/Chabok) noted as a later step (needs provider keys)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-04 15:52:06 +03:30
parent e02d976dda
commit 2d2352dfe8
13 changed files with 291 additions and 3 deletions
+3 -2
View File
@@ -13,16 +13,17 @@ export type Screen =
| "leaderboard"
| "shop"
| "chat"
| "notifications"
| "game"; // the table (used for both ai + online)
const ALL_SCREENS: Screen[] = [
"home", "auth", "profile", "friends", "online",
"room", "matchmaking", "leaderboard", "shop", "chat", "game",
"room", "matchmaking", "leaderboard", "shop", "chat", "notifications", "game",
];
/** Screens safe to restore from a URL on a cold load (no transient state needed). */
export const STATIC_SCREENS: Screen[] = [
"home", "auth", "profile", "friends", "online", "leaderboard", "shop",
"home", "auth", "profile", "friends", "online", "leaderboard", "shop", "notifications",
];
export function screenFromHash(): Screen {