I am using MVP architecture in my project. I wanted to integrate a sdk based on their sample code. Bu they are using MVVM architecture where they use coroutines with suspend method. So when the call suspend method they use viewModelScope.launch like below.
viewModelScope.launch(Dispatchers.IO) {
repository.startScan()
}
I am using presenter class. I want to use this in my onStart method. But I am not sure which scope should I use? Can I use the CoroutineScope like below. Please correct me if I am wrong.
CoroutineScope(Dispatchers.IO).launch {
scannerManager.startScan()
}