Ask for advice - How should I intergrate Facebook SDK into Clean Architecture in Android?

Viewed 342

I am using the Clean Architecture in my currently project. Now I want to integrate a feature that request Facebook SDK to execute login.

Im my opinion, Facebook SDK acts as a Data-Provider (which provide authentication service, similar to other Restful login API) and should be setup and using under data module instead of app module. For example if I want to execute Facebook Login, I will invoke appropriate use-case, then such use-case will call data module to do actual work.

But, the challenge is Facebook method (see Facebook's LoginManager, Here ), require Activity/Fragment instance to run.

So, should I move Facebook SDK back to appmodule or pass the Activity instance down to storage module?

I don't really like any options of them. (felling not happy although it helps to resolve requirement). Does anyone have any better approach? Thanks

1 Answers
Related