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

Can SocialNetworkManager.Builder have a #add method? #11

Closed
geovanisouza92 opened this issue May 13, 2014 · 5 comments
Closed

Can SocialNetworkManager.Builder have a #add method? #11

geovanisouza92 opened this issue May 13, 2014 · 5 comments

Comments

@geovanisouza92
Copy link

Hi!

Thank you for this amazing lib. It helps a lot!

I'd thinking. Is possible to Builder have a #add method to add more "social networks". For example, I want Instagram integration, but the actual lib doesn't have it. So, I can extend OAuthNetwork and implement the logic needed, but, where can I register this new network for manager?

@antonkrasov
Copy link
Owner

@geovanisouza92, Thanks :)
The issue is that Builder just prepare Bundle for SocialNetworkManager fragment,

public SocialNetworkManager build() {
            Bundle args = new Bundle();

            if (!TextUtils.isEmpty(twitterConsumerKey) && !TextUtils.isEmpty(twitterConsumerSecret)) {
                args.putString(PARAM_TWITTER_KEY, twitterConsumerKey);
                args.putString(PARAM_TWITTER_SECRET, twitterConsumerSecret);
            }

            if (!TextUtils.isEmpty(linkedInConsumerKey) && !TextUtils.isEmpty(linkedInConsumerSecret)
                    && !TextUtils.isEmpty(linkedInPermissions)) {
                args.putString(PARAM_LINKEDIN_KEY, linkedInConsumerKey);
                args.putString(PARAM_LINKEDIN_SECRET, linkedInConsumerSecret);
                args.putString(PARAM_LINKEDIN_PERMISSIONS, linkedInPermissions);
            }

            if (facebook) {
                args.putBoolean(PARAM_FACEBOOK, true);
            }

            if (googlePlus) {
                args.putBoolean(PARAM_GOOGLE_PLUS, true);
            }

            SocialNetworkManager socialNetworkManager = new SocialNetworkManager();
            socialNetworkManager.setArguments(args);
            return socialNetworkManager;
        }

So, I'm not sure how to add more "social networks" to Builder, maybe it will be possible for SocialNetworkManager, but does it have sense?
Maybe you can implement Instagram support and we will merge it to the library?

@geovanisouza92
Copy link
Author

@antonkrasov Thank you for reply quickly. Is really awful that Java doesn't support real injection like C# Extension Methods. Would be easier a lot...

Anyway, I think that merge more networks is great. I want to use the library mainly to automate the login logic to use other API methods...

@antonkrasov
Copy link
Owner

@geovanisouza92 Yes, good idea, I agree, will try to add ability to add custom SocialNetwork implementations in SocialNetworkManager today or tomorrow.
Thanks.

@antonkrasov
Copy link
Owner

@geovanisouza92 I added addSocialNetwork(SocialNetwork socialNetwork) method to SocialNetworkManager, but not completely tested it yet :)
Publishing v0.3.2 library now, I contains fix for Facebook postMessage/postPhoto and this method.

@geovanisouza92
Copy link
Author

Thank you @antonkrasov. Let's see how works :)

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

No branches or pull requests

2 participants