How to handle "Google Sign in" using android CLEAN architecture? As we know that we should avoid android code in presentation layer.
i have tried to start an "Activity" where i have managed all of my login related codes. But i tried to pass callback from this activity to my "Data Layer" using Kotlin Coroutine but can not pass this values form "Data Layer" to "Presentation Layer". Also having some issue on returning values as "Google Sign In" can be triggered any time from the user.
The presentation layer is a good place for android code such as activities and fragments.
Activities and fragments have a lifecycle where they are active or not, and this allows them to save energy when in the background. So callbacks should not be passed to the data layer, instead data from the data layer can be observed going from the repo to the viewmodel, becoming LiveData, and then you can take actions from their in the Activity/Fragment:
https://developer.android.com/topic/libraries/architecture/livedata