Closed michaloravec closed 6 months ago
Hey, when you set the version to 1.1 at the beginning of this method, it does work for you?
Yes, it does.
Without that I got Attempt to read property "media_id_string" on null
.
I know I set that API version of the twitter client in my applications myself (doesn't have to be in the package)
But there was a reason for doing it like this: because of the different versions people were using. But I can see that this can be a problem. Need to think of a solution.
How did you set API version of the twitter client in your applications?
Sorry, I got that wrong. I did that when using abrahms twitter package alone without this package.
So I guess the fix would to add the line you mentioned? I wonder if that could lead to other problems 🤔 Do you know if Twitter still only support 1.1 for media?
Media are still supported only in 1.1. You can see it in the docs.
I am pretty sure that everything will be ok. And that's because until 27. February 2024, this package only supported version 5 of the abraham/twitteroauth package, where was default API version 1.1.
Yesterday's release changes for this package changed abraham/twitteroauth support to version 6, which means the default twitter API version is current 2.
And this will cause new people who install this package or update to a newer version to have their media not working.
Sounds right, thanks. Could you make a PR for this?
I already did it.
Thanks 🙏
New release is out. Please let me know if everything is working for you. Thanks 👍
Yes, everything is working. Thank you.
Hi,
there is issue with sending media.
As you can see in the code there is a comment:
// api V2 does not support sending media yet, so I wait till after sending media to switch api version
That was added within this PR exactly 15. July 2023.
But as of version 6.0 abraham/twitteroauth which was released on July 24, 2023, the default twitter api version is 2.
This means it will be necessary to set version 1.1 using
$this->twitter->setApiVersion('1.1');
at the beginning of send method in TwitterChannel as you can see on the image below: