I've seen a lot of projects that show how to implement login in MVP, but can't find anything related to Google/Facebook login.
What should we do in the case when login flow is strongly bound to Android components life cycle? I see the main benefit of MVP in that we build an abstraction above Context
, but this abstraction will appear too complex when we need to follow, for example, Facebook login flow: you need to register FacebookCallback
with CallbackManager
, call logInWithReadPermissions()
(passing Activity/Fragment to it), delegate onActivityResult()
to callbackManager
and this will trigger FacebookCallback's methods.
What I have on mind is to create something like
interface AuthInteractor {
void doFacebookLogin();
void doGoogleLogin();
}
whose implementation will know about Context and initialize GoogleApiClient
. It will be injected in Presenter, but what with all this callbacks (especially in Facebook's SDK) things are going to become too complicated. Isn't it better to omit MVP in such cases?