youssef hachicha
08/02/2024, 9:24 PMyoussef hachicha
08/03/2024, 11:45 AMscope<WebRtcSessionManager> {
scoped<WebRtcSessionManager> {
AndroidWebRtcSessionManagerImpl()
}
}
and WebRtcSessionManager is an interface that looks like this
interface WebRtcSessionManager: KoinScopeComponent {
fun closeTheScope()
//...
}
and in my AndroidWebRtcSessionManagerImpl I am creating a scope there
class AndroidWebRtcSessionManagerImpl(
) : WebRtcSessionManager {
override val scope: Scope = createScope()
//...
}
then in my viewModel I am creating a scope and then getting my component like this
private val scopeSessionManager = getKoin().getOrCreateScope<WebRtcSessionManager>(uuid4().toString())
val sessionManager = scopeSessionManager.get<WebRtcSessionManager>()
youssef hachicha
08/03/2024, 2:54 PM