My gut is this is because the thunkable.com Live Test is running on https, but that’s only a wild guess. Anyone else had this experience and know a workaround? Dev would be much quicker if I could use the on screen Live Test.
I too had the same problem but I just live tested on a mobile phone and if you are using a laptop,
it won’t work at all and I had a self-experience on it
To connect a customizable API to thunkable web viewer in mobile you need to make sure about two things but that’s entirely up to you and how you’re building your API.
CORS
HTTPS requests.
Here is my tip on testing in Thunkable:
Do tests on your mobile Thunkable App (even though you’re not going for this platform, but you ca see if it works and do the proper adjustments to your API)
Do web testing by publishing the app as a mobile web app, you do need a PRO account (I haven’t tried it with responsive yet, but I imagine it might work too.)
Doing tests on just the web viewer preview you get on your projects is not going to work fully, so publish it first and see what works.
I deployed my API using Cloud Run in GCS, it gives you a https request API, you can code it in any programming language of your liking because you use docker
There’s nothing wrong with the API, but possibly something incompatible with puma that’s serving it in the test environment over http. It works fine using Thunkable Mobile Live View, it would just be quicker if I could test with the Web Live View. I don’t really know much about CORS but I just tried running chrome with web security disabled which (I think) would get around this issue if it was CORS related, and I expect I would get a better error.
You say “HTTPS Requests”. Are you saying that you believe that the web preview cannot call an API on an http server? It’s hitting it, it’s just hitting it with an invalid HTTP format according to my logs.
If it’s hitting it, then try publishing it as a web mobile app and try it in ‘production’. Just for better practices. I put a lot of labels you can see if it’s actually calling it correctly in Thunkable and start debugging it from there. That’s what I did and it worked, while I was debugging like this i found the CORS error just so you get a heads up haha
Hope this works for you. If not you can ask other community members
I’m sure all that is true but what I’m trying to do is get the Live View working because that will make my development work flow faster.
I’m now 99% sure what is happening is that even if the API_URL is set to http:// live view web is calling it encrypting it so this is a thunkable live view issue, not an api issue.
Confirmed. Even if your API_URL is http:// thunkable live / web will call it over SSL so the only way to build / test an API and expect it to work on both web and phone is:
a local ssl certificate configured for your dev server (webrick / puma / thin / whatever)
API_URL to https:// and that actually resolving to your server without issues / warnings which is problematic in dev environments
Unfortunately I don’t know enough about certs to deal with the subsequent issues the phone comes up against… because the cert is a kludge.
If Thunkable peeps are here, I consider this a bug. If an API_URL is http:// then the call to it shouldn’t be over SSL… but maybe that’s impossible to change?