Pregunta

I am trying to integrate Facebook and Twitter in my Android app just to post some text information.

Facebook is almost working, user can log normally, but when I execute

mSocialNetworkManager.getFacebookSocialNetwork().requestPostMessage("Facebook test", 
    new OnPostingCompleteListener() {
        @Override
        public void onPostSuccessfully(int i) {
             System.out.println("Facebook post success!");
        }

        @Override
        public void onError(int i, String s, String s2, Object o) {
             System.out.println("Facebook error: " + s2);
        }
});

No onPostSuccessfully nor onError get called. Same thing with the demo app (it shows eternally the waiting dialog). Is it a recent change in Facebook API or something wrong with the lib?

On the other side, Twitter always returns an error when trying to SocialNetwork.REQUEST_LOGIN.

Error:
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
    <?xml version="1.0" encoding="UTF-8"?>
    <hash>
    <error>Desktop applications only support the oauth_callback value 'oob'</error>
    <request>/oauth/request_token</request>
    </hash>

I think consumer key and secret are correctly set.

mSocialNetworkManager = SocialNetworkManager.Builder.from(getActivity())
                    .twitter(SocialNetworkConstants.TWITTER_API_KEY, SocialNetworkConstants.TWITTER_API_SECRET)
                    .facebook().build();

Image from API keys section

Do you know why do I get that error?

Thanks in advance.

¿Fue útil?

Solución

v0.3.2 includes fix for Facebook sharing.

As for Twitter, When you created application, did you enter OAuth callback like 'oob'? Possibly try to enter some website url as OAuth callback. Another possible issue is that you have invalid time on your phone, please check Settings -> Date & Time and insure that Automatic Date & Time checkbox is checked.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top