Receive and manage Central Hub notification state for bets, comments, and social activity.
CentralHubNotificationsProvider exposes three main notification groups:
The provider also tracks unread counters so you can badge your UI correctly.
class NotificationsViewModel : ViewModel(), KoinComponent {
private val notificationsProvider: CentralHubNotificationsProvider = get()
val notificationsState = notificationsProvider.state
init {
notificationsProvider.loadData()
}
fun markAsRead(notificationIds: List<String>) {
@Composable
fun NotificationsScreen(
viewModel: NotificationsViewModel = viewModel(),
) {
val state by viewModel.notificationsState.collectAsStateWithLifecycle()
Column {
Text("Unread Bets: ${state.numOfUnreadBetSlips}")
Text
data class CentralHubNotificationsState(
val numOfNewNotifications: Int,
val numOfUnreadBetSlips: Int,
val numOfUnreadSocial: Int,
val numOfUnreadComments: Int,
val betslipNotifications: List<BetShareNotification>,
val socialNotifications: List<SocialNotification>,
val commentNotifications: List<