I want to get the data using twitter’s fabric api but whenever i tend to verify credentials and use a callback it shows an error , specifically ,”The arguments differ in length”
void getUserData() {
Twitter.getApiClient(session).getAccountService()
.verifyCredentials(true, false, new Callback<User>() {
@Override
public void failure(TwitterException e) {
}
@Override
public void success(Result<User> userResult) {
User user = userResult.data;
String twitterImage = user.profileImageUrl;
try {
Log.d("imageurl", user.profileImageUrl);
Log.d("name", user.name);
Log.d("email",user.email);
Log.d("des", user.description);
Log.d("followers ", String.valueOf(user.followersCount));
Log.d("createdAt", user.createdAt);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
2
Answers
Just change the twitter dependency in your Build.Gradle
from
to
The new version of the .verifyCredentials() method doesn’t accept a callback hence your error.
If you check the fabric documentation, it shows two version of the method, however when I tried to open the source code in Android Studio but it had only the version without the callback.
You can solve the isssue as follows:
Source
Documentation