I recently managed to make my Unity application connect to & listen for channel point redemptions on my twitch channel - using PubSub. I then learned PubSub is being removed in April, so I’m now migrating my logic to using EventSub instead, while it’s all fresh in my head.
I’m getting an OAuth token just fine using the authorization code grant flow, I’m setting up the Websocket & receiving the welcome message, storing my session ID, but trying to then subscribe to channel point redemptions is proving a challenge.
I’m constructing a UnityWebRequest, which as far as I understand is functionally the same as the curl requests I keep seeing in the documentation, & I’m sending the EventSub Subscription as a json string, which when printed looks like that the server is expecting
And I’m also setting the headers correctly, as far as I know (it worked for PubSub doing it this way at least! )
I’ve triple checked all the variables are correct & they seem to be, I’ve triple checked the formatting & as far as I can tell they’re all correct.
Unfortunately, when this web request is sent, it returns a Connection Error & doesn’t subscribe, then of course 10 seconds pass & the websocket closes because nothing has been subscribed to.
I’m pretty new to web requests & such (I’m more of a single threaded offline game dev), so I’m hoping I’ve made an incredibly obvious mistake that just needs pointed out. If there’s some key info I haven’t provided or haven’t explained, do ask & I’ll find it.
Thanks!