twitch.listen('broadcast', function (target, contentType, color){})
I tried to test the Hello World example but there is something i don’t get it. Why this line above is never triggered ? I don’t have any error in the terminal or in the browser console about this problem. Also it seems that twitch.send() works.
Are you certain that the client is receiving a pubsub broadcast message? You should be able to validate this by checking Chrome’s dev tools. The network tab, click on the websocket connection, and click on the frame tab. You should be able to see incoming pubsub messages and confirm whether you are receiving them or not. If you are receiving them, but the event doesn’t seem to be invoked, we can work from there.
Yes i’m referring to this line but in the example when we click on the button to change the color of the circle, client send an ajax request to the EBS and the EBS send a message to the pubsub, so this is weird, the twitch.listen function should be triggered
I tried to send a broadcast message in the client using twitch.send, in the browser it seems that the message send well, but twitch.listen don’t triggered either
One issue I can see is you have a hyphen in your channel name ‘rig-test’. I did the same thing initially (think I even used the exact same name), the channel name has to be alphanumeric.
Once you change that you will also need to delete your browser’s localstorage because stuff like the token and channel name for each panel is stored there so just changing the command line argument isn’t enough.
Also in mine I used my username for the OWNER_ID rather than the userid which it looks like you are doing. From briefly reading the code it looks as though you need to use the same in both the rig and backend so maybe try using your username for both?
Also you are probably aware and it probably isn’t a big deal for your test project but you shouldn’t post your extension’s secret