I am unable to figure out how to handle login Result from FirebaseLoginRepository class back to LoginViewModel after authentication like whether it's successful or not ,should i use a callback listener as we do in MVP pattern ?
Pardon me in case of misunderstanding or some unconventional issue as this is my first question on StackOverflow
I don't know i don't have the slightest idea and couldn't find anything useful over the internet
public void login{
auth.signInWithCredential(credential).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
//using login Result callback as unable to figure out how
//to hand back result to LoginViewModel
//i am certain that doing this breaks the principle of MVVM
loginResultCallback.onSuccess();
}else {
loginResultCallback.onError();
}
}
});
}