Trouble with QR Code Scanner App

Hey guys,

I’ve been working on an App to read QR codes and I have been following along with this tutorial:
https://blog.thunkable.com/creating-a-qr-scanner-app-in-thunkable-x-c292479c5e9e
Currently my app crashes once an image is uploaded, can anybody help to figure out why?

Thanks

You’re doing a lot without managing the green error blocks. It’s important to check the value of those. Typically, you would have an If [error] block that sets the value of a label to [error] and then in the Else area, you’d have main blocks for that part.

Your JSON parsing looks correct to me so I’d be curious about the values of the error blocks.

See this: https://docs.thunkable.com/media-db.

Also, did you set the API key, etc.? Because in the project you linked above, it just says “default” for all of those values. I’m not sure if that’s just Thunkable hiding your private information when you share a project but if you haven’t set those – there’s your problem.

With a little more investigation (mainly from the error blocks values), I got this JSON result by typing the url you’re using followed by the long media url from the app screen into a browser:

[{“type”:“qrcode”,“symbol”:[{“seq”:0,“data”:null,“error”:“download error (file is too big)”}]}]

Also, from their API documentation for the “file” parameter:

An image file (e.g. a photo), which contains the QR code to read, as direct upload for the API (only possible by using a HTTP POST request).

You’re using a GET request but they require a POST request.