Since the Twitch API v3 is going to be shut down soon, the TwitchResourceOwner should be migrated to the Twitch API v5 (or even better use the new Helix API).
该提问来源于开源项目:hwi/HWIOAuthBundle
Since the Twitch API v3 is going to be shut down soon, the TwitchResourceOwner should be migrated to the Twitch API v5 (or even better use the new Helix API).
该提问来源于开源项目:hwi/HWIOAuthBundle
One way I figured out could work is to modify TwitchResourceOwner::doGetUserInformationRequest()'s return value. According to the migration guide,
developers will need to set an Accept header to specify that they want to reach v5 endpoints. Developers can proactively include the v5 Accept header in order to properly test their updates. Below is an example and you can visit the Requests documentation for more information.
curl -H 'Accept: application/vnd.twitchtv.v5+json' \
-H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \
-X GET https://api.twitch.tv/kraken/streams/
I will try to manually return something like
php
protected function doGetUserInformationRequest($url, array $parameters = array())
{
$header = array_merge(['Accept' => 'application/vnd.twitchtv.v5+json'], $this->getRequestHeaders());
return $this->httpRequest(
$url,
http_build_query($parameters, '', '&'),
$header
);
}