twitter-kit-android
twitter-kit-android copied to clipboard
Inconsistent TwitterAuthClient#authorize() unhappy scenarios handling
- Steps to reproduce the problem:
Call
TwitterAuthClient#authorize()
and don't complete the flow successfully eg. disable internet connection before or cancel.
- when there is no internet connection at the beginning:
a) nothing is displayed
b) Callback.failure()
is called with TwitterAuthException: Failed to get request token
c) resultCode in onActivityResult()
is RESULT_FIRST_USER
- when back button was clicked:
a) Callback.failure()
is called with TwitterAuthException: Authorization failed, request was canceled.
b) resultCode in onActivityResult()
is RESULT_CANCELLED
- when cancel button was clicked:
a) Callback.failure()
is called with TwitterAuthException: Failed to get authorization, bundle incomplete
b) resultCode in onActivityResult()
is RESULT_FIRST_USER
- when internet connection is lost after WebView is displayed:
a) activity with WebView is finished immediately without any error message
b) Callback.failure()
is called with TwitterAuthException: OAuth web view completed with an error
c) resultCode in onActivityResult()
is RESULT_FIRST_USER
- Expected behavior:
If it is intended to not show any error to user from Twitter kit in some cases (like 1. and 4.) then callback parameters should allow developers to easily distinguish errors from cancellations so they can show their own UI. As you can see nor
resultCode
norTwitterException
can be used for that. If it is not intended then Twitter kit should always display something after callingTwitterAuthClient#authorize()
. - Android API Version: 21+
- Android Device: all
- Artifact Versions:
+--- com.twitter.sdk.android:twitter:1.13.1
| +--- com.digits.sdk.android:digits:1.10.3
| | +--- io.fabric.sdk.android:fabric:1.3.10
| | \--- com.twitter.sdk.android:twitter-core:1.6.6
| | +--- com.squareup.retrofit:retrofit:1.8.0
| | | \--- com.google.code.gson:gson:2.3
| | +--- io.fabric.sdk.android:fabric:1.3.10
| | \--- com.google.code.gson:gson:2.2.4 -> 2.3
| +--- io.fabric.sdk.android:fabric:1.3.10
| +--- com.twitter.sdk.android:tweet-composer:1.0.3
| | +--- io.fabric.sdk.android:fabric:1.3.10
| | +--- com.twitter:twitter-text:1.13.0
| | \--- com.squareup.picasso:picasso:2.5.2
| +--- com.twitter.sdk.android:tweet-ui:1.10.1
| | +--- io.fabric.sdk.android:fabric:1.3.10
| | +--- com.android.support:support-v4:22.2.0 -> 23.3.0 (*)
| | +--- com.twitter.sdk.android:twitter-core:1.6.6 (*)
| | \--- com.squareup.picasso:picasso:2.5.2
| \--- com.twitter.sdk.android:twitter-core:1.6.6 (*)
Having the same issue...
@koral-- Did you manage to find a workaround for these issues (specifically handling the cancelling of Twitter log in)?
In Callback#failure()
method I do nothing.
If resultCode
is not in [RESULT_OK, RESULT_CANCELED]
I display a general Twitter error message to the user. In the case of other results, I do nothing.
Any news about this?
I`m getting
com.twitter.sdk.android.core.TwitterAuthException: Failed to get authorization, bundle incomplete
But Im not able to reproduce because I
m sending this error report to Fabric
Any update on this issue?
I am also getting the same.