diff --git a/composeApp/src/commonMain/kotlin/org/company/app/data/repository/YouTubeServiceImpl.kt b/composeApp/src/commonMain/kotlin/org/company/app/data/repository/YouTubeServiceImpl.kt index a70c7161..dd305ea1 100644 --- a/composeApp/src/commonMain/kotlin/org/company/app/data/repository/YouTubeServiceImpl.kt +++ b/composeApp/src/commonMain/kotlin/org/company/app/data/repository/YouTubeServiceImpl.kt @@ -1,6 +1,9 @@ package org.company.app.data.repository +import dev.gitlive.firebase.Firebase import dev.gitlive.firebase.database.FirebaseDatabase +import dev.gitlive.firebase.messaging.FirebaseMessaging +import dev.gitlive.firebase.messaging.messaging import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import org.company.app.data.remote.YoutubeClientApi @@ -45,6 +48,16 @@ class YouTubeServiceImpl( println("FetchUiData Error fetching UI data: ${e.message}") } } + suspend fun registerMessagingToken(): String{ + return Firebase.messaging.getToken() + } + + fun subscribeToTopic(topic: String) { + return Firebase.messaging.subscribeToTopic(topic) + } + fun unSubscribeToTopic(topic: String){ + return Firebase.messaging.unsubscribeFromTopic(topic) + } fun fetchLayoutInformation(): Flow = flow { fetchUiData().collect { uiData ->