Post Tweet failed


#1

Post Tweet failed
com.twitter.sdk.android.core.TwitterApiException: HTTP request failed, Status: 403
at com.twitter.sdk.android.core.Callback.onResponse(Callback.java:42)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6126)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

When I try to use fabric twitter kit App Card. I got this error, could you please help me?
Here is my code:

    TwitterSession session = TwitterCore.getInstance().getSessionManager().getActiveSession();
    String logoPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getPath() + "/logo.png";
    Card card = new Card.AppCardBuilder(context).imageUri(Uri.fromFile(new File(logoPath)))
            .iPadId(appleStoreId)
            .iPhoneId(appleStoreId)
            ..build();

    Intent intent = new ComposerActivity.Builder(context).
            session(session).card(card).createIntent();
    context.startActivity(intent);

#2

I was getting this same error (although I wasnt using App Cards) until I changed the permissions for my app from read-only to read-and-write-only and generated a new api key and secret.