Skip to content

Commit

Permalink
-Firebase Messaging Token Registeration Impl
Browse files Browse the repository at this point in the history
  • Loading branch information
KhubaibKhan4 committed Oct 13, 2024
1 parent 994140b commit 3dae074
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<LayoutInformation?> = flow {
fetchUiData().collect { uiData ->
Expand Down

0 comments on commit 3dae074

Please sign in to comment.