1

I have implemented 2 sharing methods. With facebook and with twitter.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_menu);
    adapter = new SocialAuthAdapter(new ResponseListener());
}

public void twitter(View view) {
    adapter.authorize(this, SocialAuthAdapter.Provider.TWITTER);
}

public void facebook(View view) {
    adapter.authorize(this, SocialAuthAdapter.Provider.FACEBOOK);
}

private final class ResponseListener implements DialogListener {
    public void onComplete(Bundle values) {
        adapter.updateStatus("status");
        Log.e("a", "success");
    }

    public void onError(SocialAuthError error) {
        Log.e("a", "error");
    }

    public void onCancel() {
        Log.e("a", "cancel");
    }
}

When i click any share button first time i get "success" in log and status posted. But when i click it second time i have "success" and "error" after it and status is not posted.

And exception is

    02-12 01:16:40.158: WARN/System.err(12526): org.brickred.socialauth.exception.SocialAuthException: org.brickred.socialauth.exception.SocialAuthException: Status not updated. Return Status code :400
02-12 01:16:40.158: WARN/System.err(12526): at org.brickred.socialauth.provider.FacebookImpl.updateStatus(FacebookImpl.java:276)
02-12 01:16:40.158: WARN/System.err(12526): at org.brickred.socialauth.android.SocialAuthAdapter$4.run(SocialAuthAdapter.java:414)
02-12 01:16:40.158: WARN/System.err(12526): at java.lang.Thread.run(Thread.java:856)
02-12 01:16:40.158: WARN/System.err(12526): Caused by: org.brickred.socialauth.exception.SocialAuthException: Status not updated. Return Status code :400
02-12 01:16:40.158: WARN/System.err(12526): at org.brickred.socialauth.provider.FacebookImpl.updateStatus(FacebookImpl.java:271)
02-12 01:16:40.158: WARN/System.err(12526): ... 2 more
Liza Tjaica
  • 593
  • 1
  • 7
  • 16

2 Answers2

1

You are trying to post same message twice. Facebook and twitter take it as spam and not allow this. post different message and it will be success.

user1722283
  • 234
  • 3
  • 7
0

I got the same problem and I solved it myself.

Just need to find and comment/delete bellow code on TwitterImpl.java -> updateStatus function (line 279)

if (serviceResponse.getStatus() != 200) {
    throw new SocialAuthException("Failed to update status on " + url + ". Status :" + serviceResponse.getStatus());
 }

Ref#: https://github.com/3pillarlabs/socialauth-android/issues/24

Frank Nguyen
  • 6,493
  • 3
  • 38
  • 37