Closed azkadev closed 1 year ago
Thanks for your contribution! :)
Hi @azkadev ,
Are you using v4.7.0
or higher? If so, changes have been made to the priority of tokens used in terms of the following Issue, and this is the expected behaviour.
Also, I feel that the official Twitter API is not designed to allow AppOnly and user context endpoints to be used at the same time, and OAuth 1.0a is not a top priority for this package as it is a legacy and will be deprecated authentication method.
So, the best we can do for now is to create an instance of TwitterApi
with AppOnly and user context as follows:
void main() async {
final userContextTwitter = v2.TwitterApi(
//! Must be empty.
bearerToken: "",
oauthTokens: v2.OAuthTokens(
consumerKey: "my_secret_consumer",
consumerSecret: "consumer_sceret",
accessToken: "Acces",
accessTokenSecret: "Acces_token",
),
);
final appOnlytTwitter = v2.TwitterApi(
bearerToken: "Your app-only bearer token.",
);
}
@azkadev ,
Also, you can check:
A few days ago I used your library to make a post on twitter,
my code,
But today I can't use your library anymore, error