I have seen many projects that show how to implement login in MVP, but cannot find anything related to login to Google / Facebook.
What should we do when the login thread is tied to the life cycle of the Android components? I see the main advantage of MVP is that we build the abstraction above Context , but this abstraction will be too complicated when we need to follow, for example, the Facebook login flow: you need to register FacebookCallback using CallbackManager , call logInWithReadPermissions() (passing Activity to it / Fragment), delegate onActivityResult() to the CallbackManager , and this will call the FacebookCallback methods.
What I mean is to create something like
interface AuthInteractor { void doFacebookLogin(); void doGoogleLogin(); }
whose implementation will know about Context and initialize GoogleApiClient . It will be introduced in Presenter, but with all these callbacks (especially the Facebook SDK), everything will be too complicated. Isn't it better to skip MVP in such cases?
source share