Proje: Okul B2B App · Hub: Okul B2B App — Domain
Bildirim Sistemi
Katmanlar
OneSignalService.ts ← OneSignal SDK wrapper (lazy load)
↑
NotificationManager.ts ← expo-notifications + yerel bildirim
↑
PushNotificationService.ts ← Birleşik soyutlama katmanı (tümü lazy import)
↑
NotificationContext.tsx ← Global state (bildirim listesi, unread count)
Kritik: Tüm bu servisler OTA crash nedeniyle dynamic import kullanır.
OneSignal Konfigürasyonu
- App ID:
bd4d3ce9-b440-4ded-8d00-f1f389f363c7 - Integration: FCM V1 API (Google OAuth)
- External User ID: login’de
user.idset edilir - Tags:
user_id,company_id,user_role,has_multiple_companies
Bildirim İzni
pushService.getPermissionStatus() → { granted: boolean }
iOS’ta kullanıcıdan izin istemek için requestPermission().
Badge Count
Okunmamış bildirim sayısı OneSignal badge ile senkronize edilir. NotificationService.getNotifications() response’undaki unreadCount ile güncellenir.
Deep Link Entegrasyonu
Bildirime tıklandığında DeepLinkService tetiklenir. okulcomtr:// scheme ile ilgili ekrana navigate edilir.
NotificationContext State
{
notifications: Notification[],
unreadCount: number,
hasPermission: boolean,
isLoading: boolean,
currentPage: number,
hasMorePages: boolean
}API
NotificationApiService → backend bildirim listesi çeker, okundu olarak işaretler.
Related
- analytics-event-sistemi — bildirim event’leri
- auth-akisi — login/logout’ta user ID set/remove