I now fully unsterstand how the Front End, Back End and Game parts all communicate.
Lastnight I finally got my EBS Send something to the Front End via PubSub YAY
I understand the following:
That “broadcast” is for all viewers on the channel with the extension.
That “global” is for everyone that has the extension no matter what channel they are in.
That “whisper” is for an individual user.
I am still not able to get “whisper” to work even though I set it and the permissions in the message sent from my EBS and that I am setting teh Front End to listen to “whisper-*” I receive nothing, so I must be missing setting something.
Also the “message” is used to send your message, I get that, but I am not able to send anything but a string value, when I try to have “message” as a JSON String it fails with the following error:
Yeah I understand that the “whisper” will only be when the individual user need to interact / choose something, so that “should” be a small amount of messages.
Also it seems the EBS is working fine, just that the Front End is not.
Seems that “window.Twitch.ext.viewer.opaqueId” is null I will look at your code to see if I am missing something before setting up those “listen” hooks.
Also back to the actual “message” contents, can I set that to actual JSON instead of like “foobar” due to that would limit the amount of different types of messages or is it a dumb message where you just send the whole html element block in there?
Yep that was the issue, I know I did have it in there at one point, so I must of removed it when I was testing stuff.
Now back within the onAuthorized block of code.
So now I have the Back End sending Pubsub Messages, can you give me an example message where there is a basic JSON msg within the “message” field please.
I have tried many ways to try and it returns:
Yep, that worked, seems I tried everything apart from stringify it.
So I now have Broadcast, Whisper and actual JSON based Messages.
One last question before I go, the actual content that gets displayed on say the video_overlay (like in the Cult of the Lamb game), do I send that atcual html content, or is that already in the Front End along with all the fonts & images and the PubSub Messages just trigger what one is enabled / visible and I just trigger that and send the data to populate that content.