Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with APIs which return the result in onActivityResult() #18

Open
RustamG opened this issue May 14, 2018 · 0 comments
Open

Comments

@RustamG
Copy link

RustamG commented May 14, 2018

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:

  1. Create a CallbackManager
  2. Register it via registerCallback() of LoginManager and pass a FacebookCallback there,
  3. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants