This is a movies sample app in Kotlin, which is part of a serie of blog posts I have written about architecting android application using different approaches.
How do you add integration with SDKs that deliver the result to onActivityResult method of fragment/activity? For example if you'd like to implement Authentication via Facebook SDK you would:
Pass the arguments received in onActivityResult() to the callback manager created in the step 1.
Then if you call LoginManager.getInstance().logInWithReadPermissions(fragment/activity, permissions) you will get your callback called with the result.
Besides of that, you shouldn't forget about unregistering callbacks when you're done. All of this brings quite strong coupling between components. Are there any ideas on how to keep the Dependency rule in place?
Hi,
How do you add integration with SDKs that deliver the result to
onActivityResult
method of fragment/activity? For example if you'd like to implement Authentication via Facebook SDK you would:registerCallback()
of LoginManager and pass a FacebookCallback there,onActivityResult()
to the callback manager created in the step 1.Then if you call
LoginManager.getInstance().logInWithReadPermissions(fragment/activity, permissions)
you will get your callback called with the result.Besides of that, you shouldn't forget about unregistering callbacks when you're done. All of this brings quite strong coupling between components. Are there any ideas on how to keep the Dependency rule in place?