I cannot post Twitter app card without Twitter Android APP

android
fabric
cards

#1

03-11 15:58:30.102 14576-14576/com.medzone.twitterpic E/TweetUploadService: Post Tweet failed
com.twitter.sdk.android.core.TwitterApiException: 403 Forbidden
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:383)
at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)


#2

Are you able to share the code you’re using?


#3
protected void onCreate(Bundle savedInstanceState) {
        TwitterAuthConfig authConfig = new TwitterAuthConfig("****", "********");
        Fabric.with(this, new Twitter(authConfig));
        Fabric.with(this, new TwitterCore(authConfig), new TweetUi());
        Fabric.with(this, new TwitterCore(authConfig), new TweetComposer(), new Crashlytics());

loginButton = (TwitterLoginButton) findViewById(R.id.login_button);
btnShowTweet = (Button) findViewById(R.id.btn_show_tweet);
llTweets = (LinearLayout) findViewById(R.id.ll_tweets);
btnShowTweet.setOnClickListener(this);
loginButton.setCallback(new Callback<TwitterSession>() {
    @Override
    public void success(Result<TwitterSession> result) {
//app card
final TwitterSession session = TwitterCore.getInstance().getSessionManager().getActiveSession();
final Card card = new Card.AppCardBuilder(MainActivity.this).imageUri(getImgUri()).googlePlayId("com.medzone.twitterpic").build();
final Intent intent = new ComposerActivity.Builder(MainActivity.this).session(session).card(card).createIntent();
startActivity(intent);
compile('com.twitter.sdk.android:twitter:1.13.0@aar') {
    transitive = true;
}
compile('com.twitter.sdk.android:tweet-composer:1.0.3@aar') {
    transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
    transitive = true;
}
compile('com.twitter.sdk.android:tweet-ui:1.10.0@aar') {
    transitive = true;
}