Is there a way to insert (simple) data to a webapp before it loads?
The scenario is that I have a web app and it will be displayed on a few screens, but each screen has different info…
There is a short setup screen to choose the identity which represents the physical placement of the screen.
From that point it works fine.
However. When the device is restarted (or if there is a power outage), it goes back to the setup screen because the browser is not cached (this is a remote kiosk device, so can’t be setup every time)
So, is there a way to feed a webapp information either from the browser or within the URL itself, for example: /?location=1234
And have the webapp grab that data?
I don’t want to create a load of cloned apps so I’m hoping there is a solution to this, such as somehow setting/getting the location via static text or even via a WebAPI (I build my own).
When you say webapp, do you mean the Web Viewer component? Are you trying to open a url that may change? If so, just read that url from an external data source such as a Google Sheet, Airtable or Firebase.
To clarify, I would like to setup the WebApp (e.g. https://thunkable.site/w/myappid) so that it receives some data from the browser itself, or uses some function to get device specific data, for example the hostname or (local) IP address.
The reason being, each device needs to self-identify and tell the webapp that data so it can display the correct.
If I can put something in the HTML of the webpage I create that holds the iframe for the WebApp, that the WebApp reads, that would be very useful
e.g.
<html>
<script>some identification data here</script>
<iframe src="https://thunkable.site/w/K0XDxMqwl" title="Chop Down the Tree Thunkable App" height = 500 width = 500></iframe>
</html>
Then the WebApp reads that identification data (and uses it).
If you have total control over your web page then you can send and receive messages between the web page and the Thunkable app using Web Viewer Extension.
Please see this new post as it explains things more clearly, but also is a different topic as it is about getting device data, not inserting data into a URL.