lucianchen / socialauth-android

Automatically exported from code.google.com/p/socialauth-android
0 stars 0 forks source link

facebook and twitter unable to post messages #74

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add providers with code in activity as in step 2 and add appropriate 
information to properties file for keys etc. created on provider sites.

2. code in android activitiy and on share button click I show the menu with 
providers and then select one provider.  Twitter asks for some permission which 
I hit OK and then goes further.  Facebook also shows my facebook photo and 
already authorized message with Ok and cancel buttons.  I click OK.

private void setupShare() {
        Log.d(TAG, "setupShare called in activity");
        shareButton = new Button(this);
        if(null == shareButton) {
            Log.e(TAG, "null Share Button in setupShare in activity");
        }
        shareButton.setText("Share");
        //          share.setTextColor(Color.WHITE);
        //          share.setBackgroundResource(R.drawable.button_gradient);
        adapter = new SocialAuthAdapter(new ResponseListener());

        adapter.addProvider(Provider.FACEBOOK, R.drawable.facebook);
        adapter.addProvider(Provider.TWITTER, R.drawable.twitter);
        adapter.addProvider(Provider.LINKEDIN, R.drawable.linkedin);
        //adapter.addProvider(Provider.MYSPACE, R.drawable.myspace);
        adapter.enable(shareButton);
        Log.d(TAG, "setupShare call ends in activity");

    }

    private final class ResponseListener implements DialogListener  {
        public void onComplete(Bundle values) {
            Log.d(TAG , "Authentication Successful");
            Log.d(TAG, "sharing message: shareMessage");
            adapter.updateStatus("MitenSocialAuth Android Shared Link: " + shareMessage); 
        }

        @Override
        public void onBack() {
            // TODO Auto-generated method stub

        }

        @Override
        public void onCancel() {
            // TODO Auto-generated method stub

        }

        @Override
        public void onError(SocialAuthError arg0) {
            // TODO Auto-generated method stub

        }
    }
3.

What is the expected output? What do you see instead?

Linked the message appears but for twitter and facebook I get exceptions as 
below:

Twitter:
=========
05-22 12:32:15.532: W/System.err(4333): 
org.brickred.socialauth.exception.SocialAuthException: Unable to retrieve the 
access token. Status: 401
05-22 12:32:15.532: W/System.err(4333):     at 
org.brickred.socialauth.util.OAuthConsumer.getAccessToken(OAuthConsumer.java:269
)
05-22 12:32:15.532: W/System.err(4333):     at 
org.brickred.socialauth.oauthstrategy.OAuth1.verifyResponse(OAuth1.java:97)
05-22 12:32:15.532: W/System.err(4333):     at 
org.brickred.socialauth.oauthstrategy.OAuth1.verifyResponse(OAuth1.java:107)
05-22 12:32:15.532: W/System.err(4333):     at 
org.brickred.socialauth.provider.TwitterImpl.doVerifyResponse(TwitterImpl.java:1
67)
05-22 12:32:15.532: W/System.err(4333):     at 
org.brickred.socialauth.provider.TwitterImpl.verifyResponse(TwitterImpl.java:158
)
05-22 12:32:15.532: W/System.err(4333):     at 
org.brickred.socialauth.SocialAuthManager.connect(SocialAuthManager.java:183)
05-22 12:32:15.532: W/System.err(4333):     at 
org.brickred.socialauth.android.SocialAuthDialog$SocialAuthWebViewClient$1.run(S
ocialAuthDialog.java:243)
05-22 12:32:15.532: W/System.err(4333):     at 
java.lang.Thread.run(Thread.java:856)
05-22 12:32:15.532: D/SocialAuthError(4333): 
org.brickred.socialauth.exception.SocialAuthException: Unable to retrieve the 
access token. Status: 401

Facebook
=========
05-22 12:35:03.722: I/SocialAuthManager(4333): Connecting provider : facebook
05-22 12:35:03.722: I/FacebookImpl(4333): Retrieving Access Token in verify 
response function
05-22 12:35:03.722: I/OAuth2(4333): Verifying the authentication response from 
provider
05-22 12:35:03.722: W/System.err(4333): 
org.brickred.socialauth.exception.SocialAuthException: Verification code is null
05-22 12:35:03.722: W/System.err(4333):     at 
org.brickred.socialauth.oauthstrategy.OAuth2.verifyResponse(OAuth2.java:114)
05-22 12:35:03.722: W/System.err(4333):     at 
org.brickred.socialauth.oauthstrategy.OAuth2.verifyResponse(OAuth2.java:102)
05-22 12:35:03.722: W/System.err(4333):     at 
org.brickred.socialauth.provider.FacebookImpl.doVerifyResponse(FacebookImpl.java
:164)
05-22 12:35:03.722: W/System.err(4333):     at 
org.brickred.socialauth.provider.FacebookImpl.verifyResponse(FacebookImpl.java:1
54)
05-22 12:35:03.722: W/System.err(4333):     at 
org.brickred.socialauth.SocialAuthManager.connect(SocialAuthManager.java:183)
05-22 12:35:03.722: W/System.err(4333):     at 
org.brickred.socialauth.android.SocialAuthDialog$SocialAuthWebViewClient$1.run(S
ocialAuthDialog.java:243)
05-22 12:35:03.722: W/System.err(4333):     at 
java.lang.Thread.run(Thread.java:856)
05-22 12:35:03.722: D/SocialAuthError(4333): 
org.brickred.socialauth.exception.SocialAuthException: Verification code is null

What version of the product are you using? On what operating system?
Android 4.2.2 on google nexus 7 tablet.  socialauth-android-2.0.

Please provide any additional information below.
I have even generated access code keys on twitter but I did not see any 
property that I should add that to.  I suppose the api should fetch them.

Regards,

Miten.

Original issue reported on code.google.com by indiami...@gmail.com on 22 May 2013 at 7:23

GoogleCodeExporter commented 8 years ago
Hi , please try to test with test release socialauth android 2.1. you can find 
it on issue no.52.

we are looking to release new version in next 2 weeks.

Original comment by vineet.a...@3pillarglobal.com on 22 May 2013 at 11:33

GoogleCodeExporter commented 8 years ago
Hi,

I tried 2.1 jar and linkedin, twitter works but facebook still gives same 
exception.

Regards,

Miten.

Original comment by indiami...@gmail.com on 23 May 2013 at 6:51

GoogleCodeExporter commented 8 years ago
I have a feature request.  I know that you have provision for custom ui but 
most common use case is that when use wants to tweet or message facebook etc.  
he would like to add a comment.  I suggest you add feature where in he can type 
in text (by some boolean flag whether to show it for entry or not).  As such by 
programming user is going to send details of things like article he is reading 
etc. on providers site but user comments to it is most common use case so I 
believe its worth making it default / configurable.

Original comment by indiami...@gmail.com on 23 May 2013 at 4:32

GoogleCodeExporter commented 8 years ago
another issue I am seeing here some times OK?CANCEL button also not visible at 
bottom of message "You are already authorized"...these button just display and 
went somewhere in layout which is neither visible nor layout scrollable?

any help/suggestion here.

Original comment by shubhamP...@gmail.com on 28 May 2013 at 2:32

GoogleCodeExporter commented 8 years ago
hi shubham , please post ur phone screen resloution. alos tell phone is mdpi , 
ldpi , hdpi.

Original comment by vineet.a...@3pillarglobal.com on 30 May 2013 at 2:27

GoogleCodeExporter commented 8 years ago
hi , please check latest sdk 2.5. if you still afce buttons issue , then the 
issue is related from facebook which will corrected at their end.

fixing it for facebook, twitter issue.

Original comment by l...@3pillarglobal.com on 10 Jun 2013 at 3:27