I’m trying to make a Bubble event out of what is happening with my embedded HTML element. It’s telling me to put this code in: (From here for context)
But it does not work, when I publish something the alert does not trigger. Tried putting the code in “initialize”, “update” functions and also In a HTML element, nothing. Any ideas on how to fix?
Is .observe even possible in Bubble? How do people usually get info from their custom code? Would appreciate if someone more experienced than me could chip in on this
No errors in the browser console. I’m loading in this library with an HTML element on page. It does not work when loading in from the plugin header (I think it’s because I’m on a free plan, which blocks custom HTML headers).
When you say getting info from your custom code, do you mean getting info into the bubble app? If so you would use exposed states for that.
Lets say you create an exposed state called “info” that is a type text. Lets send a string saying “this is your info data”. You would use instance.publishState(‘info’, ‘this is your info data’); That string would be passed.
Another thing is, you shouldn’t have to load your library through an html element. Did you download the cameratag.min.js, then upload the file on your plugin editor? You use that link you get from uploading and reference that in your plugin html header.
What I mean by getting info from my custom code is exactly what .observe is supposed to do.
To notice when something changes in the code, then execute a function. So I’m guessing there’s other ways to do that.
This won’t be a Bubble issue. The observe method is unique to CameraTag.
Take another look at the below… I have added in the .observe method, firstly for the initialized event (fired once the element is ready to record), and then for the publish event.
This seems to work, and I get the same outcome in Bubble too.
I just heard back from Bubble, this is what they said:
Thanks for reaching out. HTML and scripts applied on the settings tab of your app are only available on paid plans. You should be able to add HTML elements to your pages using the HTML element while on the free plan. If your plugin requires script/meta tags in the header then it will not work on a free app.
I’m not at my computer at the moment, so I’ll check again when I am, but as I recall, there are two places in a plug-in where headers can be added. I’m referring to the section corresponding to a particular element of the plug-in. I’m certain that I added a script tag with an alert, and the alert appeared when the page was loaded.